index.js
function validationMiddleware (err, req, res, next) {
  if (!err instanceof ValidationError) return next(err);
  return res.status(err.status).send({ errors: err.errors });
}
function validationMiddleware (err, req, res, next) {
  if (!err instanceof ValidationError) return next(err);
  return res.status(err.status).send({ errors: err.errors });
}
function validationMiddleware ( err , req , res , next ) { if ( ! err instanceof ValidationError ) return next ( err ) ; return res . status ( err . status ) . send ( { errors : err . errors } ) ; }
Handles thrown errors from express-validation
Handles thrown errors from express - validation