Updated error class to pass the Exception for the 500 triggered event.
This commit is contained in:
parent
63bf89efd5
commit
bc36205a99
|
|
@ -48,7 +48,8 @@
|
||||||
|
|
|
|
||||||
| Similarly, we use an event to handle the display of 500 level errors
|
| Similarly, we use an event to handle the display of 500 level errors
|
||||||
| within the application. These errors are fired when there is an
|
| within the application. These errors are fired when there is an
|
||||||
| uncaught exception thrown in the application.
|
| uncaught exception thrown in the application. The exception object
|
||||||
|
| that is captured during execution is then passed to the 500 listener.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -57,7 +58,7 @@
|
||||||
return Response::error('404');
|
return Response::error('404');
|
||||||
});
|
});
|
||||||
|
|
||||||
Event::listen('500', function()
|
Event::listen('500', function($exception)
|
||||||
{
|
{
|
||||||
return Response::error('500');
|
return Response::error('500');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ public static function exception($exception, $trace = true)
|
||||||
// Using events gives the developer more freedom.
|
// Using events gives the developer more freedom.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$response = Event::first('500');
|
$response = Event::first('500', $exception);
|
||||||
|
|
||||||
$response = Response::prepare($response);
|
$response = Response::prepare($response);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue