From 3db7799b65d32e17cc6512e169003f2248a90390 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 11 Jul 2018 16:06:10 +0800 Subject: [PATCH] fix handling exceptions --- app/Exceptions/Handler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 287a96dc..11b27057 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -6,7 +6,7 @@ use Exception; use Illuminate\Http\Response; use App\Exceptions\PrettyPageException; use Illuminate\Database\Eloquent\ModelNotFoundException; -use Illuminate\Foundation\Validation\ValidationException; +use Illuminate\Validation\ValidationException; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; @@ -112,7 +112,7 @@ class Handler extends ExceptionHandler if (request()->isMethod('GET') && !request()->ajax()) { return response()->view('errors.exception', ['message' => $e->getMessage()]); } else { - return $e->getMessage(); + return response($e->getMessage()); } } }