While you're in the development environment, Symfony shows the big exception page instead of your shiny new customized error page. So, how can you see what it looks like and debug it?
Fortunately, the default ExceptionController
allows you to preview your error pages during development.
To use this feature, you need to have a definition in your routing_dev.yml
file like so:
# app/config/routing_dev.yml
_errors:
resource: "@TwigBundle/Resources/config/routing/errors.xml"
prefix: /_error
If you're coming from an older version of Symfony, you might need to add this to your routing_dev.yml file. If you're starting from scratch, the Symfony Standard Edition already contains it for you.
With this route added, you can use URLs like:
http://localhost/app_dev.php/_error/{statusCode}
http://localhost/app_dev.php/_error/{statusCode}.{format}
to preview the error page for a given status code as HTML or for a given status code and format.
Ref: http://symfony.com/doc/current/controller/error_pages.html#testing-error-pages-during-development