[FrameworkBundle] Ensuring the exception page renders even when the Request format is unknown to Symfony

This commit is contained in:
Jordi Boggiano 2010-11-03 12:59:13 +01:00 committed by Fabien Potencier
parent a5d28d2c1b
commit e7ea2eb433

View File

@ -46,8 +46,15 @@ class ExceptionController extends ContainerAware
$exception->setStatusCode($exception->getCode());
}
$response = $this->container->get('templating')->renderResponse(
'FrameworkBundle:Exception:'.($this->container->get('kernel')->isDebug() ? 'exception.php' : 'error.php'),
$templating = $this->container->get('templating');
$template = 'FrameworkBundle:Exception:'.($this->container->get('kernel')->isDebug() ? 'exception.php' : 'error.php');
if (!$templating->exists($template)) {
$this->container->get('request')->setRequestFormat('html');
}
$response = $templating->renderResponse(
$template,
array(
'exception' => $exception,
'logger' => $logger,