0.0.5 • Published 7 years ago

exceptionable v0.0.5

Weekly downloads
20
License
MIT
Repository
github
Last release
7 years ago

exceptionable Build Status

what?

Decorator that allows you to swallow exceptions.

This should be used with care, if you really need something like this it can be useful, but if you don't it can also be a footgun.

install

npm install --save exceptionable

usage

you can define a universal decorator like this

import exceptionable from 'exceptionable';

class Example {
    @exceptionable
    static canError () {
        throw new Error('abcd');
    }
}

console.log('before error');
Example.canError();
console.log('after error');

custom handling

you can handle error logging in a custom way as well

const debug = requre('debug')('example');

@exceptionable({handler: error => debug(error.stack)})
class Example {
    static canError () {
        throw new Error('abcd');
    }
}
0.0.5

7 years ago

0.0.4

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago