diff options
-rw-r--r-- | app/Exceptions/Handler.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 217b6e1..0e458d9 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -50,8 +50,15 @@ class Handler extends ExceptionHandler { if ($exception instanceof HttpException) { $statusCode = $exception->getStatusCode(); + switch ($statusCode) { + case '404': + $codeMessage = 'Page could not be found'; + } + $errorMessage = $exception->getMessage() == '' ? ($codeMessage ? $codeMessage : 'An unknown error occurred.') : $exception->getMessage(); + + return response(View::make('errors.http', [ - 'ErrorMessage' => $exception->getMessage() == '' ? 'An unknown error occurred.' : $exception->getMessage(), + 'ErrorMessage' => $errorMessage, 'ErrorCode' => $statusCode ]), $statusCode); } |