Closed hussainb closed 9 years ago
@hussainb Please may you check sails-hook-validation spec.
You may consider fork and clone the repo then run the test. Hope they will give you an insight of your problem.But so far sails add error.ValidationError
on error object which sails-hook-validation
relies on it.
If it will help close the issue. Otherwise am here to help
I have currently decided to leave the validation messages as it is since I need to spend time on studying sails overall to get to a decision to use sailsjs or some other framework like krakenjs.
But I confirm that there is no VaildationError
property in the error object. I have tried with sails-disk adapter and sails-mongo adapter.
Sorry and thanks.
@hussainb Ok.
Same issue here. Using Sails 0.11.0.
Test fails too. As said before, if(error.ValidationError)
never enters because that property doesn't exists in the error object.
@pakzech
Which sails adapter are you using?
@lykmapipo
Using sails-mongo.
Hello,
This looked like a good solution for my custom validation message needs, but unfortunately this is not working.
I am using sails 11
Below is my model:
Dont know if this interests you or not, but this is the sails generated error object which I got form
console.log(error)
atnode_modules/sails-hook-validation/lib/create.js
line no: 50, before theif(error.ValidationError)
.Since the above
error
object do not have theValidationError
property, It will not be going into the if statement.