Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Fix php finally executing before handleThrowable()#47848
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
wouterj commentedOct 12, 2022
Thanks for investigating this and creating a patch!
I digged into this a bit more, as I don't like odd behavior 😃 What is important here is that the catch was only catching Unfortunately, I don't think we want to change the catch to However, I'm unsure what to do here. To me, it seems like we should reverte35d6ba and find a way to somehow pop the request stack for errors as well, without finally block. Let's see if some of the PHP experts in the core team have a good suggestion here :) |
gnat42 commentedOct 13, 2022
Hey@wouterj yeah, that's precisely the issue. I wondered the same thing about the Throwable vs Exception. Glad for someone else to weigh in on this. One thing I'd note is that with my patch, I get what I would consider 'expected' behaviour. I get the normal symfony exception page with the stack trace etc |
nicolas-grekas commentedOct 18, 2022
Should be fixed by#47857 |
Commite35d6ba causes some odd behaviour. What seems to be happening is a that the requestStack->pop() in the original commit in the finally{} catch is being executed before the handleThrowable() is called. This is most evident in#47358 where the LogoutUrlGenerator attempts to get a request from the requestStack but it is gone.
I verified using xdebug and breakpoints that the code in finally was being called first. With this patch, the original tests ine35d6ba continue to pass and my project where I reported the issue#47358 is not longer occurring.