protected function handleException(\Exception $exception)
    {
        $response = new Response();

        $exceptionMessage = '';
        $exceptionReference = "\n<b>More Information</b>\n";
        $exceptionReference .= "  Exception code      #" . $exception->getCode() . "\n";
        $exceptionReference .= "  File                " . $exception->getFile() . ($exception->getLine() ? ' line ' . $exception->getLine() : '') . "\n";
        $exceptionReference .= ($exception instanceof FlowException ? "  Exception reference #" . $exception->getReferenceCode() . "\n" : '');
        foreach (explode(chr(10), wordwrap($exception->getMessage(), 73)) as $messageLine) {
            $exceptionMessage .= "  $messageLine\n";
        }

        $response->setContent(sprintf("<b>Uncaught Exception</b>\n%s%s\n", $exceptionMessage, $exceptionReference));
        $response->send();
        exit(1);
    }
protected function handleException(\Exception $exception)
    {
        $response = new Response();

        $exceptionMessage = '';
        $exceptionReference = "\n<b>More Information</b>\n";
        $exceptionReference .= "  Exception code      #" . $exception->getCode() . "\n";
        $exceptionReference .= "  File                " . $exception->getFile() . ($exception->getLine() ? ' line ' . $exception->getLine() : '') . "\n";
        $exceptionReference .= ($exception instanceof FlowException ? "  Exception reference #" . $exception->getReferenceCode() . "\n" : '');
        foreach (explode(chr(10), wordwrap($exception->getMessage(), 73)) as $messageLine) {
            $exceptionMessage .= "  $messageLine\n";
        }

        $response->setContent(sprintf("<b>Uncaught Exception</b>\n%s%s\n", $exceptionMessage, $exceptionReference));
        $response->send();
        exit(1);
    }
protected function handleException ( \ Exception $ exception ) { $ response = new Response ( ) ; $ exceptionMessage = '' ; $ exceptionReference = "\n<b>More Information</b>\n" ; $ exceptionReference .= "  Exception code      #" . $ exception -> getCode ( ) . "\n" ; $ exceptionReference .= "  File                " . $ exception -> getFile ( ) . ( $ exception -> getLine ( ) ? ' line ' . $ exception -> getLine ( ) : '' ) . "\n" ; $ exceptionReference .= ( $ exception instanceof FlowException ? "  Exception reference #" . $ exception -> getReferenceCode ( ) . "\n" : '' ) ; foreach ( explode ( chr ( 10 ) , wordwrap ( $ exception -> getMessage ( ) , 73 ) ) as $ messageLine ) { $ exceptionMessage .= "  $messageLine\n" ; } $ response -> setContent ( sprintf ( "<b>Uncaught Exception</b>\n%s%s\n" , $ exceptionMessage , $ exceptionReference ) ) ; $ response -> send ( ) ; exit ( 1 ) ; }
Displays a human readable, partly beautified version of the given exception
and stops the application, return a non-zero exit code.

@param \Exception $exception
@return void
Displays a human readable partly beautified version of the given exception and stops the application return a non - zero exit code .