2.0.6 • Published 2 years ago

error-maker v2.0.6

Weekly downloads
1
License
GPL-3.0
Repository
github
Last release
2 years ago

Error Maker

Error Maker is a library for making new error types easily.

Installation

Use the package manager npm or yarn to install Error Maker.

npm i error-maker
# OR
yarn add error-maker

Usage

Using CommonJS

const ErrorFactory = require('error-maker');
const ValidationError = ErrorFactory.create('ValidationError');
// ...
throw new ValidationError('Invalid input');
// Or you can specify an additional cause
throw new ValidationError('Invalid input', 'there it goes!');

Using ES Modules

import ErrorFactory from 'error-maker';
const ValidationError = ErrorFactory.create('ValidationError');
// ...
throw new ValidationError('Invalid input');
// Or you can specify an additional cause
throw new ValidationError('Invalid input', 'there it goes!');

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GPL-3.0

2.0.6

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

4 years ago

1.0.0

4 years ago