Browse Source

完善错误输出

dev
李可松 4 years ago
parent
commit
24958cf799
  1. 13
      app/Exceptions/Handler.php

13
app/Exceptions/Handler.php

@ -75,8 +75,8 @@ class Handler extends ExceptionHandler
'status' => 500,
]);
}
//TypeError && ParseError
if ($e instanceof \TypeError || $e instanceof \ParseError) {
//TypeError && ParseError && Exception
if ($e instanceof \TypeError || $e instanceof \ParseError || $e instanceof \Exception) {
return response()->json([
'code' => -1,
'msg' => $e->getMessage(),
@ -87,15 +87,6 @@ class Handler extends ExceptionHandler
]);
}
//Exception
if ($e instanceof \Exception) {
return response()->json([
'code' => -1,
'msg' => $e->getMessage(),
'data' => [],
'status' => 500,
]);
}
//Exception
if ($e instanceof \Error) {
return response()->json([
'code' => -1,

Loading…
Cancel
Save