protected function prepareResponse($request, Exception $e)
    {
        if (! $this->isHttpException($e) && config('app.debug')) {
            return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e);
        }

        if (! $this->isHttpException($e)) {
            $e = new HttpException(500, $e->getMessage());
        }

        return $this->toIlluminateResponse(
            $this->renderHttpException($e), $e
        );
    }
protected function prepareResponse($request, Exception $e)
    {
        if (! $this->isHttpException($e) && config('app.debug')) {
            return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e);
        }

        if (! $this->isHttpException($e)) {
            $e = new HttpException(500, $e->getMessage());
        }

        return $this->toIlluminateResponse(
            $this->renderHttpException($e), $e
        );
    }
protected function prepareResponse ( $ request , Exception $ e ) { if ( ! $ this -> isHttpException ( $ e ) && config ( 'app.debug' ) ) { return $ this -> toIlluminateResponse ( $ this -> convertExceptionToResponse ( $ e ) , $ e ) ; } if ( ! $ this -> isHttpException ( $ e ) ) { $ e = new HttpException ( 500 , $ e -> getMessage ( ) ) ; } return $ this -> toIlluminateResponse ( $ this -> renderHttpException ( $ e ) , $ e ) ; }
Prepare a response for the given exception.

@param  \Illuminate\Http\Request  $request
@param  \Exception $e
@return \Symfony\Component\HttpFoundation\Response
Prepare a response for the given exception .