Neos\Flow\Error\DebugExceptionHandler::echoExceptionWeb PHP Method

echoExceptionWeb() protected method

Formats and echoes the exception as XHTML.
protected echoExceptionWeb ( object $exception ) : void
$exception object \Exception or \Throwable
return void
    protected function echoExceptionWeb($exception)
    {
        $statusCode = 500;
        if ($exception instanceof FlowException) {
            $statusCode = $exception->getStatusCode();
        }
        $statusMessage = Response::getStatusMessageByCode($statusCode);
        if (!headers_sent()) {
            header(sprintf('HTTP/1.1 %s %s', $statusCode, $statusMessage));
        }
        if (isset($this->renderingOptions['templatePathAndFilename'])) {
            try {
                echo $this->buildView($exception, $this->renderingOptions)->render();
            } catch (\Throwable $throwable) {
                $this->renderStatically($statusCode, $throwable);
            } catch (\Exception $exception) {
                $this->renderStatically($statusCode, $exception);
            }
        } else {
            $this->renderStatically($statusCode, $exception);
        }
    }