By default, Symfony uses showActionof Symfony\Bundle\TwigBundle\Controller\ExceptionControllerto display your error page. The implementation in Symfony 2.3 looks like this:
public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null, $_format = 'html')
{
$currentContent = $this->getAndCleanOutputBuffering($request->headers->get('X-Php-Ob-Level', -1));
$code = $exception->getStatusCode();
return new Response($this->twig->render(
$this->findTemplate($request, $_format, $code, $this->debug),
array(
'status_code' => $code,
'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '',
'exception' => $exception,
'logger' => $logger,
'currentContent' => $currentContent,
)
));
}
, 'exception' => $exception, . $exception Symfony\Component\HttpKernel\Exception\FlattenException, PHP Exception.
FlattenException::getMessage, , . . FlattenException API.