From bc36205a99826193da0a26d564d37cfb93661c2b Mon Sep 17 00:00:00 2001 From: Kirk Bushell Date: Fri, 15 Feb 2013 09:50:32 +1100 Subject: [PATCH] Updated error class to pass the Exception for the 500 triggered event. --- application/routes.php | 5 +++-- laravel/error.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/application/routes.php b/application/routes.php index 2892da90..06547e0f 100644 --- a/application/routes.php +++ b/application/routes.php @@ -48,7 +48,8 @@ | | Similarly, we use an event to handle the display of 500 level errors | 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'); }); -Event::listen('500', function() +Event::listen('500', function($exception) { return Response::error('500'); }); diff --git a/laravel/error.php b/laravel/error.php index c4c1ac6b..7de0919a 100644 --- a/laravel/error.php +++ b/laravel/error.php @@ -54,7 +54,7 @@ public static function exception($exception, $trace = true) // Using events gives the developer more freedom. else { - $response = Event::first('500'); + $response = Event::first('500', $exception); $response = Response::prepare($response); }