diff options
author | Chaoyi Zha <summermontreal@gmail.com> | 2018-02-12 01:05:57 +0300 |
---|---|---|
committer | Chaoyi Zha <summermontreal@gmail.com> | 2018-02-12 01:05:57 +0300 |
commit | c0ce7d4d6eeeac57c3dda926741fa006f2da7cb2 (patch) | |
tree | bdeeeb7942f4f89a8acf69dfb00618a14bf3ff35 | |
parent | 09724050c285fe63ef87f2ec50cf2cd0f1211ff6 (diff) |
Use proper HTTP response code for pretty 500 page; reduce line length
-rw-r--r-- | app/Exceptions/Handler.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index e1b16ba..4229462 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -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) { |