Pradeep Sathyaraj
Pradeep Sathyaraj

Reputation: 134

Symfony2 Overiding Exception

Recently, I've put the error.html.twig, error404.html.twig, exception.html.twig templates to the app/Resources/TwigBundle/views/Exception project directory to override Symfony2 error pages. In the prod environment it's working fine; in the dev environment also its overriding the default exception template, so it is very hard for debugging.

How can I get the default template working in the dev environment.

Upvotes: 0

Views: 371

Answers (1)

AlterPHP
AlterPHP

Reputation: 12727

Overriding exception.html.twig is a mistake as it is only available in DEV environment, and you don't want a custom exception template.

Extract from official doc:

The debug-friendly exception pages shown to the developer can even be customized in the same way by creating templates such as exception.html.twig for the standard HTML exception page or exception.json.twig for the JSON exception page.

Upvotes: 4

Related Questions