diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index a6d5381..e8750db 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -75,6 +75,15 @@ class Handler extends ExceptionHandler 'status' => 500, ]); } + //Exception + if ($e instanceof \Exception) { + return response()->json([ + 'code' => -1, + 'msg' => $e->getMessage(), + 'data' => [], + 'status' => 500, + ]); + } return parent::render($request, $e); } }