Try changes to the handler

This commit is contained in:
James Cole 2016-02-11 14:17:11 +01:00
parent 7e8fea6ed3
commit 6e5bca8306

View File

@ -42,6 +42,29 @@ class Handler extends ExceptionHandler
*/ */
public function render($request, Exception $exception) 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) { if ($exception instanceof FireflyException || $exception instanceof ErrorException) {
// log // log
@ -75,26 +98,9 @@ class Handler extends ExceptionHandler
// could also not mail! :o // could also not mail! :o
Log::error($e->getMessage()); 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); parent::report($exception);
} }
} }