make-error

Package Versionarrow-up-right Build Statusarrow-up-right PackagePhobiaarrow-up-right Latest Commitarrow-up-right

Make your own error types!

Features

  • Compatible Node & browsers

  • instanceof support

  • error.name & error.stack support

  • compatible with CSParrow-up-right (i.e. no eval())

Installation

Installation of the npm packagearrow-up-right:

> npm install --save make-error

Then require the package:

var makeError = require("make-error");

Browser

You can directly use the build provided at unpkg.comarrow-up-right:

Usage

Basic named error

Advanced error class

Specialized error

Inheritance

Best for ES2015+.

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

License

ISC © Julien Fontanetarrow-up-right

Last updated