Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.22 KB

error_handling.md

File metadata and controls

33 lines (22 loc) · 1.22 KB

Error Handling

Error pages

Error page templates can be found in templates/bundles/TwigBundle/Exception.

Which template is used and how errors are displayed to end users depend on the exception type.

Client exceptions (HTTP 400, 403, 404, etc.)

If a NotFoundHttpException or AccessDeniedHttpException is thrown, a BeWelcome themed page will be shown with a friendly message, using the templates error404.html.twig and error403.html.twig, respectively.

These two templates both extend the base BeWelcome base.html.twig template, so they are shown in the context of the full website theme.

Server exceptions (HTTP 500)

If an unhandled application exception is thrown, we cannot assume it is possible to display the full website theme, so we must show a much simpler page using the template error.html.twig.

Preferably this page should not include any external assets as we cannot guarantee the state of the external environment. Any required CSS/JS should be inline or in the <head> tag, and images embedded using the data URI scheme.

Debug mode

In a dev environment or with debug mode active Symfony error pages are shown instead of customized BeWelcome pages.