改进 错误返回
This commit is contained in:
parent
a5f4facead
commit
a2e65e688a
@ -49,6 +49,17 @@ public function report(Throwable $exception)
|
|||||||
*/
|
*/
|
||||||
public function render($request, Throwable $exception)
|
public function render($request, Throwable $exception)
|
||||||
{
|
{
|
||||||
return parent::render($request, $exception);
|
|
||||||
|
$rendered = parent::render($request, $exception);
|
||||||
|
|
||||||
|
return response()->json(
|
||||||
|
[
|
||||||
|
'error' => [
|
||||||
|
'code' => $rendered->getStatusCode(),
|
||||||
|
'message' => $exception->getMessage(),
|
||||||
|
]
|
||||||
|
],
|
||||||
|
$rendered->getStatusCode()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user