Treblle / treblle-laravel

The official Treblle SDK for Laravel. Seamlessly integrate Treblle to manage communication with your dashboard, send errors, and secure sensitive data.
https://www.treblle.com/
MIT License
129 stars 24 forks source link

TypeError: ProcessRequest constructor rejects JsonResponse #40

Closed stephenjude closed 1 year ago

stephenjude commented 1 year ago

Version

Description

When I return a Illuminate\Http\JsonResponse, like this:

response()->json([
    'message' => 'Valid response',
]);

I get a type error that only Illuminate\Http\Response is acceptable.

Stacktrace

TypeError: Treblle\Jobs\ProcessRequest::__construct(): Argument #2 ($response) must be of type Illuminate\Http\Response, Illuminate\Http\JsonResponse given, called in vendor/treblle/treblle-laravel/src/Middlewares/TreblleMiddleware.php on line 39 and defined in vendor/treblle/treblle-laravel/src/Jobs/ProcessRequest.php:40
Stack trace:
JustSteveKing commented 1 year ago

Hey @stephenjude thanks for this! I have just released a new minor version which should resolve this problem 😄

Thanks for reporting the bug!