src/Core/Exceptions/Handler.php
protected function convertExceptionToResponse(Exception $e)
    {
        $headers = $this->isHttpException($e) ? $e->getHeaders() : [];
        $statusCode = $this->isHttpException($e) ? $e->getStatusCode() : 500;

        try {
            $content = config('app.debug') && class_exists(Whoops::class)
                ? $this->renderExceptionWithWhoops($e)
                : $this->renderExceptionWithSymfony($e, config('app.debug'));
        } catch (Exception $e) {
            $content = $content ?? $this->renderExceptionWithSymfony($e, config('app.debug'));
        }

        return SymfonyResponse::create(
            $content,
            $statusCode,
            $headers
        );
    }
protected function convertExceptionToResponse(Exception $e)
    {
        $headers = $this->isHttpException($e) ? $e->getHeaders() : [];
        $statusCode = $this->isHttpException($e) ? $e->getStatusCode() : 500;

        try {
            $content = config('app.debug') && class_exists(Whoops::class)
                ? $this->renderExceptionWithWhoops($e)
                : $this->renderExceptionWithSymfony($e, config('app.debug'));
        } catch (Exception $e) {
            $content = $content ?? $this->renderExceptionWithSymfony($e, config('app.debug'));
        }

        return SymfonyResponse::create(
            $content,
            $statusCode,
            $headers
        );
    }
protected function convertExceptionToResponse ( Exception $ e ) { $ headers = $ this -> isHttpException ( $ e ) ? $ e -> getHeaders ( ) : [ ] ; $ statusCode = $ this -> isHttpException ( $ e ) ? $ e -> getStatusCode ( ) : 500 ; try { $ content = config ( 'app.debug' ) && class_exists ( Whoops :: class ) ? $ this -> renderExceptionWithWhoops ( $ e ) : $ this -> renderExceptionWithSymfony ( $ e , config ( 'app.debug' ) ) ; } catch ( Exception $ e ) { $ content = $ content ?? $ this -> renderExceptionWithSymfony ( $ e , config ( 'app.debug' ) ) ; } return SymfonyResponse :: create ( $ content , $ statusCode , $ headers ) ; }
Convert an exception to a response instance.

@param Exception $e

@throws \Illuminate\Container\EntryNotFoundException

@return \Symfony\Component\HttpFoundation\Response
Convert an exception to a response instance .