/** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param \Exception $e * @return \Illuminate\Http\Response */ public function render($request, Exception $e) { if ($e instanceof NotosException) { $e = new HttpException($e->getStatus(), $e->getMessage(), $e->getPrevious(), [], $e->getCode()); $response = new JsonResponse($e->getMessage(), $e->getStatusCode(), []); $response->exception = $e; return $response; } if ($e instanceof ModelNotFoundException) { $e = new NotFoundHttpException($e->getMessage(), $e); } return parent::render($request, $e); }