How to show custom 500 error page in production only in symfony?

I created a custom 500 error page by overriding the default 500 page. I did this by creating exception.html.twig template in templates/bundles/TwigBundle/Exception/exception.html.twig. But the problem is that it shows this template in all environments when a 500 error occurs.

How can I tell the application to show exception.html.twig template only in production? In dev and local I want to display the exceptions to the user as we have in normal applications.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *