-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.2] custom error pages seem to be broken #7366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have exactly the same problem. My error pages don't render "Symfony\Bundle\TwigBundle\Controller\ExceptionController" anymore instead It likes in symfony 2.2.0 error pages are rendered with "Symfony\Component\HttpKernel\Debug\ExceptionHandler" in dev environment. In prod error pages are not rendered at all. I can't get symfony 2.2.0 to render my custom error pages in prod environment. |
I found solution. <parameters>
<parameter key="my_twig.controller.exception.class">Bundle\MyTwigBundle\Controller\ExceptionController</parameter>
</parameters>
<services>
<service id="my_twig.controller.exception" class="%my_twig.controller.exception.class%">
<argument type="service" id="twig" />
<argument>%kernel.debug%</argument>
</service>
</services> Third in your configuration file (config.yml) add this
not like documentation says
This should be added in documentation for symfony 2.2.0 |
So this can be considered as a not yet documented BC break? The change is only mentioned in TwigBundle's CHANGELOG file in 35d63df. The service definition can be stripped down a bit to something like <service id="my_twig.controller.exception"
class="%my_twig.controller.exception.class%"
parent="twig.controller.exception">
</service> |
@craue I agree with your service definition. |
That bug aside, would #7446 also meet your needs? |
The reference needs to be updated: http://symfony.com/doc/2.2/reference/configuration/twig.html#config-twig-exception-controller In SO there is an answer to this problem as well: http://stackoverflow.com/a/15773923/267705 |
Closing this old ticket. |
With 2.1.8, I'm using the
twig.exception_controller
config option to specify a custom exception controller (using the bundle notation) to be able to check in the dev env how my custom error pages (likeapp/Resources/TwigBundle/views/Exception/error404.html.twig
) would look like. After upgrading to 2.2.0 and some code changes to my exception controller (changed method signature ofshowAction
), I'm unable to let my custom error pages being rendered, neither using that exception controller in dev env (showAction
is not called at all) nor in the prod env (just a blank page, not even a default error page).Did something change in handling custom error pages or using a custom exception controller? The UPGRADE file doesn't mention anything and I can't spot any difference between http://symfony.com/doc/2.1/cookbook/controller/error_pages.html and http://symfony.com/doc/2.2/cookbook/controller/error_pages.html.
The text was updated successfully, but these errors were encountered: