-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Development of custom error pages is impractical if you need to set kernel.debug=false #3577
Conversation
…pment of custom error pages.
@@ -110,3 +110,24 @@ Symfony uses the following algorithm to determine which template to use: | |||
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. | |||
|
|||
Testing Error Pages during development |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During Development
+1, I like having references to 3rd party bundles to help with common tasks. However, I'd like to have this in a |
|
||
But setting ``kernel.debug`` to ``false`` during development to write | ||
or test your custom error pages is impractical as it stops Symfony2 from | ||
recompiling the Twig templates, among other things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[...] impractical as, among other things, it stops Symfony2 from recompiling the Twig templates.
Maybe it's better if we make the section a bit shorter. Among the lines of: In the development environment, the |
Move section on testing error pages during development into a sidebar and make it shorter.
@@ -29,13 +29,30 @@ control you need: | |||
which allows complete control over exception handling. For more | |||
information, see :ref:`kernel-kernel.exception`. | |||
|
|||
The default ``ExceptionController`` will either display an | |||
*exception* or *error* page, depending on the setting of the ``kernel | |||
.debug`` flag. While *exception* pages give you a lot of helpful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should put kernel.debug
on one line
Fixed |
error pages during development. This will also stop | ||
Symfony2 from recompiling your twig templates, among other things. | ||
|
||
The third-party `webfactory/exceptions-bundle`_ provides a special |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use WebfactoryExceptionsBundle.
@xabbuh You're right, the bundle name is better than the composer vendor/package combo. |
bump |
Hey Matthias! Thanks for the bundle and this change - this is a very annoying thing indeed. Maybe someday it'll be in core, but until then, as Wouter mentioned, we should link to the best tool for the job. I haven't tried your bundle yet, so hopefully it's good ;). I think you should register it on KnpBundles.com too so it's a bit easier to find. And you will now be able to update your blog post where it references that we don't talk about this problem yet on the docs ;). Anyways, thanks a bunch! |
… need to set kernel.debug=false (mpdude) This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #3577). Discussion ---------- Development of custom error pages is impractical if you need to set kernel.debug=false Also see symfony/symfony#7446 and symfony/symfony#1486 Commits ------- 6aa90e0 Use WebfactoryExceptionsBundle instead of webfactory/exceptions-bundle 2fee263 Update error_pages.rst 435019c Point out the difference between error and exception pages. 2194607 Add a pointer to webfactory/exceptions-bundle which helps with development of custom error pages.
Also see
symfony/symfony#7446 and symfony/symfony#1486