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
Middleware fail fast #1100
Comments
Hi there, there is currently no way to accomplish what you are trying to. |
Hi @fedeci, I would like to work on this issue. Some guidance on how to solve this problem will be appreciated since I'm new to this type of stuff. |
I think we could throw the error and can prevent the calling next function or we can call the next with and error argument |
I would like to work on this issue! |
hi @tejastomarbyte, take a look at #1214 🙂 |
Hi hi, https://github.com/express-validator/express-validator/releases/tag/v7.0.0 is out with a fix for this 🙂 |
I managed to find a way to fail-fast the validation chain with bail, but what about failing fast the middleware list?
Say, I have
If the name validation fails, I don't care to check phoneNumber anymore... Wasn't able to find a way to fail fast in this case. In the case above, if both validations fail, I will get errors for both of them.
The text was updated successfully, but these errors were encountered: