/**
* {@inheritdoc}
*/
public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null)
{
$code = $exception->getStatusCode();
$showException = $request->attributes->get('showException', $this->debug);
$template = $this->requestAnalyzer->getWebspace()->getTheme()->getErrorTemplate($code);
if ($showException || $request->getRequestFormat() !== 'html' || $template === null) {
return parent::showAction($request, $exception, $logger);
}
$currentContent = $this->getAndCleanOutputBuffering($request->headers->get('X-Php-Ob-Level', -1));
$parameter = ['status_code' => $code, 'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '', 'exception' => $exception, 'currentContent' => $currentContent];
$data = $this->parameterResolver->resolve($parameter, $this->requestAnalyzer);
return new Response($this->twig->render($template, $data), $code);
}