Merge pull request #2732 from Wv5twkFEKh54vo4tta9yu7dHa3/staging

Use same json error format as Mastodon
pull/2738/head
daniel 5 years ago committed by GitHub
commit bd27ecb68e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,6 +48,11 @@ class Handler extends ExceptionHandler
*/
public function render($request, Throwable $exception)
{
if ($request->wantsJson())
return response()->json(
['error' => $exception->getMessage()],
method_exists($exception, 'getStatusCode') ? $exception->getStatusCode() : 500
);
return parent::render($request, $exception);
}
}

Loading…
Cancel
Save