Skip to content Skip to sidebar Skip to footer

Sails-mongo Adapter, Normalize Error Messages

I am trying out sailsJs with mongodb using the sails-mongo adapter. After adding validations to a model, I get the following response when the validation fails. Users.js Model: mod

Solution 1:

sails.js is just reporting the error given by the database. It's just the case that sails-disk has nicer error messages. The sails-mongo adapter ends up giving you the error that's reported directly by the database; so to prettify these, you'd just need to map the raw errors into more user-friendly messages just like any other database driver.


Post a Comment for "Sails-mongo Adapter, Normalize Error Messages"