symfony: Display only error 500, when you have the wrong configuration in debug mode.
Symfony version(s) affected: 4.4.*
Description
When you have the wrong configuration, instead of showing exceptions, an 500 page is displayed.
This problem does not depend on the environment.
How to reproduce
Just set malformed *.ymal file something like this :
# config/routes/annotations.yaml
;321-
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (9 by maintainers)
Can you check which
Debug::enable()
call you have in your front controller ? Symfony 4.4 contains 2 such classes:Symfony\Component\Debug\Debug
Symfony\Component\ErrorHandler\Debug
Maybe the issue happens only when using the old Debug class (i.e. when upgrading Symfony without updating the front controller) ?
I can confirm the problem coming from 4.0 to 4.4 😃 The debug page is not shown when using
instead of
Is there any fix to this yet?
This is an absolute problem. How do I get Symfony to record in the error logs WTF it is erroring out? I can’t fix anything If I don’t have any info to go by. This one thing is keeping me from getting my Symfony app from working. This is the stupidest thing I have ever encountered.
@nicolas-grekas looks like something is still wrong in the BC layer when using the old component. It might be good to fix it if possible.
After searching a bit in code, I found out that this line is maybe the reason it doesn’t catch exceptions. As of php 7, errors are not reported using traditional error mechanisms, but reported as exception of type
Error
.To test this, I just changed \Exception to \Error, and the exception is displayed.