1.Unified Error Handling for servers and clients(browsers, android, ios)
2.Customizable error definitions
3.A standard general error standard for restful apis
nodejs/iojs
$ npm install --save web-errors
bower
$ bower install --save web-errors
nodejs/iojs
var errors = require('web-errors').errors;
browser
<script src="bower_components/web-errors/dist/web-errors.js"></script>
var webErrors = require('web-errors');
var conf = {
data: {
entities: '../lib/data/entities',
properties: '../lib/data/properties',
types: '../lib/data/types',
events: '../lib/data/events',
errors: '../lib/data/errors'
},
i18n: {
"zh-CN": '../lib/data/i18n/zh-CN',
"en-US": '../lib/data/i18n/en-US'
}
};
webErrors.set(conf.data, config.i18n);
MIT © calidion