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) { $user = Auth::check() ? Auth::user() : new User; $data = [ 'class' => get_class($exception), 'errorMessage' => $exception->getMessage(), 'time' => date('r'), 'stackTrace' => $exception->getTraceAsString(), 'file' => $exception->getFile(), 'line' => $exception->getLine(), 'code' => $exception->getCode(), ]; // create job that will mail. $job = new MailError($user, env('SITE_OWNER'), Request::ip(), $data); dispatch($job); } parent::report($exception); } }