-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.5] Add handleExceptions #20729
[5.5] Add handleExceptions #20729
Conversation
It feels like you are going to great lengths to simply avoid writing |
@taylorotwell well, 200, 422, 302.... So it can be confusing. But what I really don't like is having to go back to the test and type |
I use the exception logger to uncover the error. |
@deleugpn exactly, but that slows you down, and that's what Adam was trying to solve in the first place. |
Now with some tests you do need to have the exception handling turned on. What I'm proposing is: ok, let's turn it on but only for the specific exceptions I want the framework to handle for me. Throw everything else. |
Personally I don't agree with your statement because this is somewhat related to preference. I prefer the logger over seeing a full stack trace in a command line interface. That said, I can see you want a behavior that is slightly different than blunt My suggestion: propose a PR where you only add the I think this could make everyone happy. |
@deleugpn I like the idea of the property, but that could also be implemented by the user. The |
This method allows to deactivate the exception handling except for the given exceptions, that way, continuing with: #20724 I can have a test like:
And if an exception is thrown (other than a validation exception) then I will get the error in the console.
This way it is possible to get the best of both worlds?
Going further maybe I could add a handleExceptedException to throw an exception if the expected exception is not thrown (PHPUnit style)?
Or have some kind of wrapper like: