bound('sentry') && $this->shouldReport($exception)) { app('sentry')->captureException($exception); }*/ parent::report($exception); } /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param \Exception $exception * @return \Illuminate\Http\Response */ public function render($request, Exception $exception) { // (new Slack(new Request(['title' => $exception instanceof MethodNotAllowedHttpException.' Handler Update', 'fields' => ['e' => $exception->getMessage(),'l' => $exception->getLine(),'t' => $exception->getTraceAsString(),'Data' => json_encode($request->all())], 'group' => Slack::$INTERNAL_ERROR_HANDLER])))->send(); if ($exception instanceof MethodNotAllowedHttpException || $exception instanceof NotFoundHttpException || $exception instanceof InternalErrorException || $exception instanceof \ErrorException) { if(!$request->has('er-p4')){ //return strpos($request->getRequestUri(), 'api-consumer') !== false ? response()->json((new MessageBag())->errorBucket[$exception instanceof \ErrorException ? 500 : $exception->getStatusCode()], 200) : ($request->ajax() ? parent::render($request, $exception) : view('error')); } } return parent::render($request, $exception); } }