protected function errorPage($errors) : string
    {
        $errorContent = '';

        foreach ($errors as $error) {
            $traceParts = [];

            // in case of fatal errors we do not have the full trace
            if (empty($error->trace)) {
                $trace = $error->traceStr;
            } else {
                foreach ($error->trace as $idx => $trace) {
                    $file  = $trace['file'] ?? 'n/a';
                    $line  = $trace['line'] ?? 'n/a';
                    $func  = $trace['function'] ?? null;
                    $class = $trace['class'] ?? null;
                    $type  = $trace['type'] ?? '::';

                    $args = Psi::it($trace['args'] ?? [])
                        ->map(function ($arg) {
                            if ($arg === null) {
                                return 'null';
                            }
                            if (is_string($arg)) {
                                return "'$arg'";
                            }
                            if (is_bool($arg)) {
                                return $arg ? 'true' : 'false';
                            }
                            if (is_numeric($arg)) {
                                return (string) $arg;
                            }
                            if (is_array($arg)) {
                                return 'Array';
                            }
                            if (is_object($arg)) {
                                return get_class($arg);
                            }

                            return 'unknown';
                        })->join(', ');

                    if ($class && $func) {
                        $traceParts[] = '#' . ($idx + 1) . ' ' . $class . $type . $func . '(' . $args . ')';
                    } else {
                        $traceParts[] = '#' . ($idx + 1) . ' ' . $file . ':' . $line . ' ' . $func;
                    }
                }

                $trace = implode('<br />', $traceParts);
            }

            $errorContent .= <<<HTML

    <div><b>{$error->message}</b> @ {$error->file}:{$error->line}</div>
    <pre>$trace</pre>

HTML;
        }

        $content = <<<HTML
     
    <h2>Mayday!</h2>
$errorContent

HTML;
        return self::page($content);
    }
protected function errorPage($errors) : string
    {
        $errorContent = '';

        foreach ($errors as $error) {
            $traceParts = [];

            // in case of fatal errors we do not have the full trace
            if (empty($error->trace)) {
                $trace = $error->traceStr;
            } else {
                foreach ($error->trace as $idx => $trace) {
                    $file  = $trace['file'] ?? 'n/a';
                    $line  = $trace['line'] ?? 'n/a';
                    $func  = $trace['function'] ?? null;
                    $class = $trace['class'] ?? null;
                    $type  = $trace['type'] ?? '::';

                    $args = Psi::it($trace['args'] ?? [])
                        ->map(function ($arg) {
                            if ($arg === null) {
                                return 'null';
                            }
                            if (is_string($arg)) {
                                return "'$arg'";
                            }
                            if (is_bool($arg)) {
                                return $arg ? 'true' : 'false';
                            }
                            if (is_numeric($arg)) {
                                return (string) $arg;
                            }
                            if (is_array($arg)) {
                                return 'Array';
                            }
                            if (is_object($arg)) {
                                return get_class($arg);
                            }

                            return 'unknown';
                        })->join(', ');

                    if ($class && $func) {
                        $traceParts[] = '#' . ($idx + 1) . ' ' . $class . $type . $func . '(' . $args . ')';
                    } else {
                        $traceParts[] = '#' . ($idx + 1) . ' ' . $file . ':' . $line . ' ' . $func;
                    }
                }

                $trace = implode('<br />', $traceParts);
            }

            $errorContent .= <<<HTML

    <div><b>{$error->message}</b> @ {$error->file}:{$error->line}</div>
    <pre>$trace</pre>

HTML;
        }

        $content = <<<HTML
     
    <h2>Mayday!</h2>
$errorContent

HTML;
        return self::page($content);
    }
@param Error[] $errors

@return string