From 6e5bca8306fd05f29eee60f5b2270a43f50802eb Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 11 Feb 2016 14:17:11 +0100 Subject: [PATCH] Try changes to the handler --- app/Exceptions/Handler.php | 42 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index b4ead350ef..3595acf0c3 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -42,6 +42,29 @@ class Handler extends ExceptionHandler */ public function render($request, Exception $exception) { + if ($exception instanceof FireflyException || $exception instanceof ErrorException) { + + $isDebug = env('APP_DEBUG', false); + + return response()->view('errors.FireflyException', ['exception' => $exception, 'debug' => $isDebug], 500); + } + + return parent::render($request, $exception); + } + + + /** + * Report or log an exception. + * + * This is a great spot to send exceptions to Sentry, Bugsnag, etc. + * + * @param Exception $exception + * + * @return void + */ + public function report(Exception $exception) + { + if ($exception instanceof FireflyException || $exception instanceof ErrorException) { // log @@ -75,26 +98,9 @@ class Handler extends ExceptionHandler // could also not mail! :o Log::error($e->getMessage()); } - $isDebug = env('APP_DEBUG', false); - - return response()->view('errors.FireflyException', ['exception' => $exception, 'debug' => $isDebug], 500); + } - return parent::render($request, $exception); - } - - - /** - * Report or log an exception. - * - * This is a great spot to send exceptions to Sentry, Bugsnag, etc. - * - * @param Exception $exception - * - * @return void - */ - public function report(Exception $exception) - { parent::report($exception); } }