Comments (6)
@pboris can you provide a more complete code sample to reproduce this issue? That would be great!
from express-validator.
I have not tried to reproduce this, but I wonder if what pboris is seeing could be handled by changing to use the Validator prototype. I see on the node validator repo an example using it:
Validator.prototype.error = function (msg) {
this._errors.push(msg);
return this;
}
Maybe placing the error function on the instance lets a thrown error get through?
from express-validator.
@smakinson can you provide an example?
from express-validator.
Now that I am coming back to this and looking at the node-validator page again, I think I mis-spoke since error handlers can be added in both places. But I just saw an error like this on something else I am using and I'd guess he is seeing an error from calling match on something that is not a string. Perhaps a side effect from the chaining?
I have not written any code to investigate.
from express-validator.
Closing as this conversation was going nowhere and no has responded since 2013.
from express-validator.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from express-validator.
Related Issues (20)
- Property 'errors' is private and only accessible within class 'Result<T>'. HOT 4
- Is checkExact() with wildcards supported? HOT 2
- Unexpected change in behaviour v6/v7 for .notEmpty() HOT 1
- Usage of exist, if in checkSchema
- Validation on nested fields not working. HOT 1
- validationResult function don't give any Error HOT 3
- Empty array as default value not working. HOT 1
- isDate() returns false on "2021-02-12" for express-validator v7 HOT 5
- Re-use validators on the front end? HOT 3
- How to pass parameters to a custom validator using schemas HOT 2
- TS Error. Type 'IsURLOptions' does not include some properties
- const {query} = require("express-validator") not working but {check} is working HOT 1
- How to stop the validation flow to different checks HOT 1
- How can I prevent isStrongPassword() accepting whitespaces? HOT 1
- Validate json object HOT 6
- Able to use validation inside controller? HOT 5
- How to use if inside ParamSchema? HOT 1
- Check if a field is either a string or an Array of Strings HOT 1
- Using oneOf together with checkExact causes Unknown Field errors HOT 2
- How to keep keys for optional fields in matchedData?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-validator.