Reputation: 58
i am using sequelize.js nodejs as backend. when there is a validation error/ unique error/ null error it is sequelize validation error. Basically i want to get error as node js error. It is displaying everything in the error. I would like to show only the path and message .
current error showing
{
"name": "SequelizeValidationError",
"message": "Validation error: Validation notEmpty failed",
"errors": [
{
"message": "Validation notEmpty failed",
"type": "Validation error",
"path": "name",
"value": {},
"__raw": {}
}
]
}
i want this
{
"name":"The field cannot be empty",
"other_field":"custom error message"
}
Upvotes: 0
Views: 854