Neos\Fusion\Core\ExceptionHandlers\HtmlMessageHandler::handle PHP Method

handle() protected method

Renders the exception in HTML for display
protected handle ( string $typoScriptPath, Exception $exception, integer $referenceCode ) : string
$typoScriptPath string path causing the exception
$exception Exception exception to handle
$referenceCode integer
return string
    protected function handle($typoScriptPath, \Exception $exception, $referenceCode)
    {
        $messageArray = array('header' => 'An exception was thrown while Neos tried to render your page', 'content' => htmlspecialchars($exception->getMessage()), 'stacktrace' => $this->formatTypoScriptPath($typoScriptPath), 'referenceCode' => $this->formatErrorCodeMessage($referenceCode));
        $messageBody = sprintf('<p class="neos-message-content">%s</p>' . '<p class="neos-message-stacktrace"><code>%s</code></p>', $messageArray['content'], $messageArray['stacktrace']);
        if ($referenceCode) {
            $messageBody = sprintf('%s<p class="neos-reference-code">%s</p>', $messageBody, $messageArray['referenceCode']);
        }
        $message = sprintf('<div class="neos-message-header"><div class="neos-message-icon"><i class="icon-warning-sign"></i></div><h1>%s</h1></div>' . '<div class="neos-message-wrapper">%s</div>', $messageArray['header'], $messageBody);
        $this->systemLogger->logException($exception);
        return $message;
    }