-
Notifications
You must be signed in to change notification settings - Fork 6
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
Returning errors instead of throwing? #9
Comments
You are right. But do you know any other way to pass validation failure to exception handler on middleware level? |
Yes it can be done using a little bit of reflection. It feels "dirty", but it's still faster than using exceptions. (Doing it that way there is no need for exception handlers, the conversion from validation failure to HTTP response can be done in the controller.) However I still hope there is another way, without exceptions and reflection. (Feel free to close. Take a look at that link it's excellent.) |
Using exceptions for flow control is very "heavy".
Anyone figure out how to return a result with errors, instead of throwing exceptions?
The text was updated successfully, but these errors were encountered: