symfony/symfony — pull request #9155 by fabpot (2013-09-27 21:45:50+00:00)
Title: ExceptionController's debug is now twig.options.debug, not a kernel.debug

This PR was submitted on the symfony/TwigBundle read-only repository and moved automatically to the main Symfony repository (closes symfony/TwigBundle#1).

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT

TwigBundle exposes configuration setting `debug` which is by default equal to `%kernel.debug%`.
This value can be overridden, but Twig's built-in ExceptionController always uses `%kernel.debug%` instead of `twig.oprions['debug']` so overriding does not affect it.
See e.g. [this question on StackOverflow](http://stackoverflow.com/questions/16833201/symfony-2-get-error-instead-of-debug-page-on-test-environment-how-to-set-deb)
I faced this problem when tried to write tests for my custom 404 page. I set twig.debug to "false" in config_test.yml, but it still displayed stacktrace info instead of my custom 404 page