1.2.2 • Published 11 years ago
sailor-errorify v1.2.2
Errorify for Sailor
Error normalizer for Sailor. Extend express-validator-errors interface.
Install
npm install sailor-errorifyUsage
errorify = require 'sailor-errorify'or using sailor dependency
sailor = require 'sailorjs'
errorify = sailor.errorifyAPI
Ideal for response with error schema, for example:
unless user
return errorify
.add 'identifier', translate.get('User.NotFound'), user
.end res, 'notFound'In this case return a notFound response:
{
"errors": [
{
"param": "identifier",
"msg": "Identifier doesn't found"
}
]
}License
MIT © Kiko Beats