LaraBug / LaraBug

Laravel error reporting tool
https://www.larabug.com
MIT License
267 stars 58 forks source link

422 Unprocessable Entity error from larabug api #46

Closed bobo-le closed 3 years ago

bobo-le commented 3 years ago

Hey, I haven't received any exceptions for a few days. I tested with the following exception:

public function me(Request $request)
{
    throw new Exception();
    return new UserResource($request->user());
}

Inside the report function in Client.php, a Guzzle-Request-Exception is thrown with the following message:

Client error: `POST https://www.larabug.com/api/log` resulted in a `422 Unprocessable Entity` response:
{"error":"Did not receive the correct parameters to process this exception"}

The login and project-id is set correctly, as well the user and exception parameters.

Tested with version 2.3.1

sinnbeck commented 3 years ago

Did a bit of testing. The issue comes from the fact that the exception is empty.

This wont work

public function me(Request $request)
{
    throw new Exception();
    return new UserResource($request->user());
}

While this will

public function me(Request $request)
{
    throw new Exception('Some error message');
    return new UserResource($request->user());
}
bobo-le commented 3 years ago

Thank you.