Version: 0.1.0.
Status: completed
Create custom error objects for the Application.
- Strict and readable code enforced with xo.
- Unit tested with
mocha
.
$ npm install https://github.com/jasancheg/x-error.git
const MyError = require('x-error')('MyError', { code: 'ENOENT' });
// or
const MyError = require('x-error')('MyError', 501);
Create new errors with the resulting object. The first argument is the error message. The second is an object containing keys that will decorate the error, overriding any keys set by the factory.
$ make test