laravel-api-debugger icon indicating copy to clipboard operation
laravel-api-debugger copied to clipboard

Does not display query if exception is thrown

Open harveyslash opened this issue 8 years ago • 3 comments

First of all, great package, thanks !

I noticed a problem though. if an error is caught like so: catch ( QueryException $e) { $mssg = "An account with these details already exists"; return response()->json(["error_list" => compact('mssg')]); }

the sql key inside debug is blank. any way to fix this ?

harveyslash avatar Jun 09 '16 06:06 harveyslash

Thanks for info, never encountered such bug. Let me debug a bit and I'll let you know

mlanin avatar Jun 14 '16 12:06 mlanin

@harveyslash sorry for the delay. Can you show me the whole code example?

mlanin avatar Feb 21 '17 09:02 mlanin

I'm having almost the same issue, but in my case I don't catch the error, I throw exceptions and want the code to strop there, so I don't need to return this exception, but the debug obj don't return with the exception

$json_response = response()->json($response, $this->getStatusCode(), $headers);
throw new HttpResponseException($json_response);

spacedog4 avatar Jun 24 '20 13:06 spacedog4