getStatusCode(); switch ($statusCode) { case '404': $codeMessage = 'Page could not be found.'; } $errorMessage = $exception->getMessage() == '' ? (isset($codeMessage) ? $codeMessage : 'An unknown error occurred.') : $exception->getMessage(); return response(View::make('errors.http', [ 'ErrorMessage' => $errorMessage, 'ErrorCode' => $statusCode ]), $statusCode); } return parent::render($request, $exception); } }