Skip to content

jasancheg/x-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

x-error

XO code style

Version: 0.1.0.

Status: completed

Create custom error objects for the Application.

Features

  • Strict and readable code enforced with xo.
  • Unit tested with mocha.

Installation

$ npm install https://github.com/jasancheg/x-error.git

Usage

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.

Run Test

$ make test

License

© 2018 MIT License. Made with ♥️ - 🇨🇷 - Inidea - Tonisan.

About

Create custom errors objects

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published