1.0.1 • Published 7 years ago

catch-filter v1.0.1

Weekly downloads
7
License
MIT
Repository
-
Last release
7 years ago

catch-filter

Function that helps to catch specific types of errors and rethrows another.

Example

const catchFilter = require('catch-filter');
try {
  doSomethingThrowing();
} catch (e) {
  catchFilter(
    [TypeError, error => handleTypeError(error)],
    [Error, error => handleOtherError(error)],
  )(e);
}
1.0.1

7 years ago

1.0.0

7 years ago