1

Does express-validator provide error method which always throw error? (Latest version: v3.1.2)

I'm using following custom method, but if there is smarter way, I would like to know.

app.use(expressValidator({
  customValidators: {
    fail: function() {
      return false;
    }
  }
}));

Thank you.

yaitloutou
  • 1,691
  • 19
  • 23
Yuto Segoe
  • 11
  • 1
  • What is the use case? Why you want to create this custom method in express-validator? Can you use nodejs custom errors instead? Please see this example. http://stackoverflow.com/questions/783818/how-do-i-create-a-custom-error-in-javascript – bgth Jan 30 '17 at 14:54

0 Answers0