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);
}
}