Skip to content

Commit 7fe61b7

Browse files
committed
Merge pull request laravel#1711 from torm3nt/master
Event firing of 500s now passes along the $exception object
2 parents 3f803d4 + bc36205 commit 7fe61b7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

application/routes.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
|
4949
| Similarly, we use an event to handle the display of 500 level errors
5050
| within the application. These errors are fired when there is an
51-
| uncaught exception thrown in the application.
51+
| uncaught exception thrown in the application. The exception object
52+
| that is captured during execution is then passed to the 500 listener.
5253
|
5354
*/
5455

@@ -57,7 +58,7 @@
5758
return Response::error('404');
5859
});
5960

60-
Event::listen('500', function()
61+
Event::listen('500', function($exception)
6162
{
6263
return Response::error('500');
6364
});

laravel/error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function exception($exception, $trace = true)
5454
// Using events gives the developer more freedom.
5555
else
5656
{
57-
$response = Event::first('500');
57+
$response = Event::first('500', $exception);
5858

5959
$response = Response::prepare($response);
6060
}

0 commit comments

Comments
 (0)