Skip to content

pyldin601/catch-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
}

About

Function that catches one errors and rethrows another

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published