public function sendExceptionResponse($exception): void
    {
        if (! headers_sent()) {
            if ($exception instanceof HttpException) {
                header(sprintf('HTTP/1.0 %s', $exception->getStatusCode()));

                foreach ($exception->getHeaders() as $name => $value) {
                    header($name . ': ' . $value, false);
                }
            }

            header('Content-Type: text/html; charset=' . $this->charset);
        }

        echo $this->html($this->getContent($exception), $this->getStylesheet());
    }