Thanks to visit codestin.com
Credit goes to github.com

Skip to content

HttpException not caught within Browserkit/Client->request #27720

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

Closed
dominikzogg opened this issue Jun 26, 2018 · 12 comments
Closed

HttpException not caught within Browserkit/Client->request #27720

dominikzogg opened this issue Jun 26, 2018 · 12 comments

Comments

@dominikzogg
Copy link

Symfony version(s) affected:3.4.12

Description
After updating from symfony 3.4.11 => 3.4.12 many of our integration tests break, cause Symfony\Component\HttpKernel\Exception get not catched anymore. Instead of a response with 400 in case of BadRequestHttpException, the test failed cause this exception.

@xabbuh
Copy link
Member

xabbuh commented Jun 26, 2018

Can you create a minimal example application that allows to reproduce your issue?

@nicolas-grekas
Copy link
Member

Related to #27516? This was a BC break that has been reverted (see l linked issue.)

@dominikzogg
Copy link
Author

@dominikzogg
Copy link
Author

@nicolas-grekas seems so, cause i had the error after removing some bundles (twig and security are two of them)

@nicolas-grekas
Copy link
Member

This means you should fix your code I suppose, "not a bug"...

@dominikzogg
Copy link
Author

@nicolas-grekas well, i used a original standard edition for demo, dropped twig, and this means all kernel exceptions need to catch by ourself?

@nicolas-grekas
Copy link
Member

Yes, that's always been the case except in a few 3.4/4.0 versions but that introduced a BC break. You need to register an exception listener (what TwigBundle does) or to catch the exception yourself.

@dominikzogg
Copy link
Author

Can you explain me, what http exception handling has to do with twig?

@nicolas-grekas
Copy link
Member

@javiereguiluz javiereguiluz changed the title HttpException did not catched within Browserkit/Client->request HttpException not caught within Browserkit/Client->request Jun 26, 2018
@RonnieRocket147
Copy link

I have the same issue after upgrading from 3.4.11 to 3.4.12. When pages were not found it generated a nice standard error page (https://www.dropbox.com/s/udevmgjwra0p4zf/Screenshot%202018-06-27%2022.12.27.png?dl=0) but now an 500 Internal Server error is returned and the logs show

[critical] Uncaught Exception: Unable to find the controller for path "/non_existing". The route is wrongly configured.

@nicolas-grekas
Copy link
Member

Yep, sorry about that. This behavior might be reintroduced but as a new feature on 4.2 (see #27519) and with an implementation that doesn't break BC.

@nicolas-grekas
Copy link
Member

You can register an exception listener instead by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants