private static function outputErrorHtml(string $message, $timestamp, string $file = 'unknown', $line = '?', $exception = null)
    {
        // TODO this needs to be moved to a template and be improved
        if (empty($timestamp)) {
            $timestamp = time();
        }
        
        $traceHtml = '';
        if(is_string($exception)) {
            $traceHtml = '<p>'. nl2br($exception) .'</p>';
        }
        
        if (!is_null($exception) && empty($traceHtml)) {
            $traceHtml = '<p><b>Stacktrace:</b><pre>' . addslashes($exception->getTraceAsString()) . '</pre>';
        }
        
        $fileHtml = '';
        if ($file && $line) {
            $fileHtml = CHAR_CRLF . '<p><b>Origin:</b><pre>' . $file . ':' . $line . '</pre></p>';
        }
        
        echo '<div style="border: 4px groove #FF0000; background-color: #FFCCCC; padding: 5px 10px; word-wrap: break-word; word-break: break-all;">' . CHAR_CRLF . '<h2 style="margin: 0px 0px 5px 0px;">Error: ' . nl2br($message) . '</h2><br /><p style="margin: 0px 0px 5px 0px;"><b>Time:</b><pre>' . date('c', $timestamp) . '</pre></p>' . $fileHtml . CHAR_CRLF . $traceHtml . CHAR_CRLF . '</div>';
    }