Created
July 11, 2014 08:58
-
-
Save haani-niyaz/db083f9cf9629737f7d6 to your computer and use it in GitHub Desktop.
Laravel app error function with view and status code in response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App::error(function(Exception $exception, $code) | |
{ | |
Log::error($exception->getMessage()); | |
switch ($code) { | |
case 404: | |
return Response::view('errors.404',array(), 404); | |
break; | |
default: | |
return Response::view('errors.default'); | |
break; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment