This package has been deprecated

Author message:

This package is no longer maintained.

typed-errors

1.1.0 • Public • Published

typed-errors

Create custom error types that work with instanceof and have stack traces.

Usage

Consider the following from our tests:

require('should');
var makeTypedError = require('typed-errors').makeTypedError;
var FooException = makeTypedError('FooException');
 
it('should be an instanceof', function () {
    try {
        throw new FooException('Foobar!');
    } catch (e) {
        e.should.be.an.instanceof(FooException);
        e.should.be.an.instanceof(Error);
    }
});

Installation

npm install typed-errors

Contribute

  • Issue Tracker: github.com/bodylabs/typed-errors/issues
  • Source Code: github.com/bodylabs/typed-errors

Pull requests welcome!

Support

If you are having issues, please let us know.

License

The project is licensed under the two-clause BSD license.

/typed-errors/

    Package Sidebar

    Install

    npm i typed-errors

    Weekly Downloads

    1,131

    Version

    1.1.0

    License

    BSD-2-Clause

    Last publish

    Collaborators

    • gmarceau
    • paulmelnikow
    • qmaurmann