-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Provide status code in fragment handler exception #37537
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
Conversation
Can you please target master? That'd be a new feature. |
sure! |
@nicolas-grekas done, and tests updated |
425eccb
to
c966456
Compare
Build fails don't seem related to my changes |
@fabpot Updated with suggested changes |
This does not only make the status code of the subrequest available in the exception. It also make it being used as the status code of the master request now (as the thrown exception is an HttpException) when this subrequest does not happen in Twig (I think Twig might be wrapping the HttpException into a Twig RuntimeError exception). Maybe we should provide an HttpException only as the previous exception here. |
Polite reminder if someone can assess which suggestion to go for please? |
I'm fine with @stof suggestion. Tests do not pass though. |
824f6de
to
6ae672a
Compare
6ae672a
to
81ca1f0
Compare
PR Updated! |
Thank you @gonzalovilaseca. |
We have a use case where it would be useful to retrieve the status code in an exception listener from the exception thrown by the fragment handler, current solution is to extract it from the exception string which is ugly.
With this change we can get the status code from the exception directly.