I am trying to use mdg:validdation-error.
I can generate the ValidationError but the thrown error is not returning as something that I can process.
for exemple:
methods.js
// method name,
validate(doc){
if (doc.name.length === 0){
throw new ValidationError([
{
name: 'name',
type: 'must have value',
value: doc.name,
}
]);
}
},
// reset of the method
addList-form.js
insert.call(doc, (err, rers) => {
if (err) {
console.log('has validating err')
}
})
but it isn’t printed to the console:
Does someone sees what am I doing wrong?
Thanks