diff options
author | Chaoyi Zha <summermontreal@gmail.com> | 2018-02-12 01:06:12 +0300 |
---|---|---|
committer | Chaoyi Zha <summermontreal@gmail.com> | 2018-02-12 01:06:12 +0300 |
commit | 010f7c3f7b630cfdf60f4401b8619ce875e4e154 (patch) | |
tree | bdeeeb7942f4f89a8acf69dfb00618a14bf3ff35 | |
parent | c62f51476f42387624f84da8e90d586b1d3a1a25 (diff) | |
parent | c0ce7d4d6eeeac57c3dda926741fa006f2da7cb2 (diff) |
Merge branch 'sc0rp10-master'
-rw-r--r-- | app/Exceptions/Handler.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 2afb883..4229462 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -51,7 +51,7 @@ class Handler extends ExceptionHandler { return redirect()->to(env('SETTING_INDEX_REDIRECT')); } // Otherwise, show a nice error page - return view('errors.404'); + return response(view('errors.404'), 404); } if ($e instanceof HttpException) { // Handle HTTP exceptions thrown by public-facing controllers @@ -60,11 +60,15 @@ class Handler extends ExceptionHandler { if ($status_code == 500) { // Render a nice error page for 500s - return view('errors.500'); + return response(view('errors.500'), 500); } else { // If not 500, render generic page - return response(view('errors.generic', ['status_code' => $status_code, 'status_message' => $status_message]), $status_code); + return response( + view('errors.generic', [ + 'status_code' => $status_code, + 'status_message' => $status_message + ]), $status_code); } } if ($e instanceof ApiException) { |