I Have table with fields:
name:string;
idUser:integer;
on my model validator I added
...
idUser: {
type: sequelize.INTEGER,
validate: {
isInt: true,
equals: 7
}
}
...
now if I post data with idUser = 100, I can catch this error with catch function(equals error works and I can send it to UI), but if I pass idUser = "someNotInteger" I get error Unhandled rejection SequelizeValidationError: "someNotIntege" is not a valid integer, but I can't catch it, only see this error in console. From stack trace I see equals validator use tryCatcher, but isInt validator use INTEGER.validate from data-types.js. This is really bad, because nodejs app will be terminated in such situations.