You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug symfony#58289 [HttpKernel] Skip logging uncaught exceptions in ErrorHandler, assume $kernel->terminateWithException() will do it (nicolas-grekas)
This PR was merged into the 5.4 branch.
Discussion
----------
[HttpKernel] Skip logging uncaught exceptions in `ErrorHandler`, assume `$kernel->terminateWithException()` will do it
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fixsymfony#57902
| License | MIT
When uncaught exceptions are handled by `ErrorHandler::handleException()`, that method logs them, then calls a callback to let the app know about the exception itself.
This causes two issues:
1. that log happens without context, which leads to symfony#57902
2. logs are duplicated: one by ErrorHandler, twice by the callback
In this PR, I propose to consider that if terminateWithException is configured as a callback, we assume that the app will handle the logging on its own.
Tested in practice, this works nicely.
Adding a test case is quite complex as all this involves many pieces and global state, so I skipped adding one.
Commits
-------
3b87c32 [HttpKernel] Skip logging uncaught exceptions in ErrorHandler, assume $kernel->terminateWithException() will do it
0 commit comments