catch-filter
v1.0.1
Published
Function that helps to catch specific error classes and passes other through
Downloads
2
Readme
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);
}