-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] ErrorListener doesnt convert throwable to legacy FlattenException for controller argument #34661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
…ebug\Exception\FlattenException` in controller
Temporary workaround for me (in case, that I should preserve BC with ^3.4|^4.0 versions) - drop typehint in controller argument. |
I'm confused here, your DI config refers to |
Sorry for misleading DI config example. I didn't change typehint in controller due to reason, that controller located in bundle, that supports Listener I replaced via DI extension on build (after check for current symfony version |
I see, that it's hard for me to explain my implementation. So, I created gist. |
…on in controller (andrew-demb) This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [HttpKernel] Support typehint to deprecated FlattenException in controller | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34661 | License | MIT | Doc PR | We should support converting throwable to `FlattenException` with typehint to deprecated class also Commits ------- 26b4e37 [HttpKernel] Support typehint to deprecated FlattenException in controller
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 4.4.0
Description
ErrorListener doesnt convert throwable to legacy FlattenException for controller argument and it leads to exception:
How to reproduce
Declare controller with
Symfony\Component\Debug\Exception\FlattenException
argument,use
Symfony\Component\HttpKernel\EventListener\ErrorListener
with configured reference to controller.Possible Solution
Check
Symfony\Component\Debug\Exception\FlattenException
heresymfony/src/Symfony/Component/HttpKernel/EventListener/ErrorListener.php
Line 101 in 1b4ab81
Additional context
DI config:
Controller example:
The text was updated successfully, but these errors were encountered: