sailor-errorify

1.2.2 • Public • Published
![](http://i.imgur.com/vLYNR8r.png)

Errorify for Sailor

Build Status Dependency status Dev Dependencies Status NPM Status Gittip

Error normalizer for Sailor. Extend express-validator-errors interface.

Install

npm install sailor-errorify

Usage

errorify = require 'sailor-errorify'

or using sailor dependency

sailor   = require 'sailorjs'
errorify = sailor.errorify

API

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

Package Sidebar

Install

npm i sailor-errorify

Weekly Downloads

1

Version

1.2.2

License

MIT

Last publish

Collaborators

  • kikobeats