This question is related to the following change (part of Symfony 2.2 release):
Part 1
In pre-2.2 Symfony, I was overriding ExceptionController
to display some custom error pages.
I did that via:
parameters:
twig.exception_listener.controller: My\CustomBundle\CustomExceptionController::showAction
Now, after upgrading to 2.2, I can no longer do that, because an exception is thrown while generating an exception (no pun intended):
ExceptionController::__construct() must be an instance of Twig_Environment, none given, called in...
Since ExceptionController
is a service now, how can I override that, and what do I need to change in my old code?
All I did in the custom class, is changed the template reference in showAction method:
$template = new TemplateReference('TwigBundle', 'Exception', $name, $format, 'twig');
Part 2
Since ExceptionController
no longer extends ContainerAware
, how do I get to the current container? Is it enough to implement ContainerAwareInterface
?