Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Development of custom error pages is impractical if you need to set kernel.debug=false #3577

wants to merge 4 commits into from

Conversation

mpdude
Copy link
Contributor

@mpdude mpdude commented Feb 13, 2014

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During Development

@wouterj
Copy link
Member

wouterj commented Feb 13, 2014

+1, I like having references to 3rd party bundles to help with common tasks.

However, I'd like to have this in a .. sidebar:: instead.


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.
Copy link
Member

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.

@wouterj
Copy link
Member

wouterj commented Feb 13, 2014

Maybe it's better if we make the section a bit shorter. Among the lines of:

In the development environment, the ExceptionController of the TwigBundle is used instead of error pages. When testing your code in the production environment, the twig templates cache won't be updated, this means it's hard to test your custom error pages. Luckily, the webfactory/exceptions-bundle_ solves this issue by providing a test controller.

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
Copy link
Member

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

@mpdude
Copy link
Contributor Author

mpdude commented Feb 13, 2014

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use WebfactoryExceptionsBundle.

@mpdude
Copy link
Contributor Author

mpdude commented Feb 17, 2014

@xabbuh You're right, the bundle name is better than the composer vendor/package combo.

@mpdude
Copy link
Contributor Author

mpdude commented Mar 8, 2014

bump

@weaverryan
Copy link
Member

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!

weaverryan added a commit that referenced this pull request Mar 9, 2014
… 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.
@weaverryan weaverryan closed this Mar 9, 2014
@mpdude mpdude deleted the add-note-exceptions-bundle branch March 10, 2014 23:26
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants