bound('sentry') && $this->shouldReport($e)) { app('sentry')->captureException($e); } return parent::report($e); } /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param \Exception $e * @return \Illuminate\Http\Response * @todo Perhaps replace odd encrypted error with Sentry notification */ public function render($request, Exception $e) { if ($e instanceof ModelNotFoundException) { $e = new NotFoundHttpException($e->getMessage(), $e); } if ($this->isUnauthorizedException($e)) { $e = new HttpException(403, $e->getMessage()); } if ($this->isHttpException($e)) { return $this->toIlluminateResponse($this->renderHttpException($e), $e); } else { $res = \Response::make( view('errors.500', ['exception' => $e]), 500); $res->exception = $e; return $res; } //return parent::render($request, $e); } }