Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Array to string converstion #55

Open
evaleries opened this issue Mar 16, 2022 · 2 comments
Open

Error: Array to string converstion #55

evaleries opened this issue Mar 16, 2022 · 2 comments

Comments

@evaleries
Copy link

evaleries commented Mar 16, 2022

Hello,

I'm getting an error when using this package.
Currently, I'm using Laravel 8 and PHP 7.4

Here's my snippet code

try {
  Catcher::get()
      ->sendException($exception, ['version' => config('amf.version'), 'env' => config('app.env')]);

} catch (Exception $e) {
    Log::error($e->getMessage());
}

The $exception variable is an Exception instance. The problem still occurs even without a context.

Here's the detailed log:

local.ERROR: Array to string conversion . 
<br>file:  /Users/redacted/vendor/codex-team/hawk.php/src/Transport/CurlTransport.php 
<br>line: 56 

I think because we're trying to send an array using curl from this line.

curl_setopt($curl, CURLOPT_POSTFIELDS, $event->jsonSerialize());

My working solution:

curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($event->jsonSerialize()));
@khaydarov
Copy link
Member

@evaleries Hi! Will check it out soon. Thanks!

@evaleries evaleries changed the title Error: Array to sting converstion Error: Array to string converstion Mar 17, 2022
@unbreak
Copy link

unbreak commented Mar 16, 2023

This Notice still occurs with Symfony 5.4 and php 7.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants