diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index d896fa1..2faf9c9 100644 --- a/app/Exceptions/Handler.php +++ b/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,