Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce catchByCode #40

Open
medikoo opened this issue Sep 10, 2015 · 0 comments
Open

Introduce catchByCode #40

medikoo opened this issue Sep 10, 2015 · 0 comments
Assignees
Milestone

Comments

@medikoo
Copy link
Owner

medikoo commented Sep 10, 2015

So we can narrow callback to be called only in case of specific error type:

promise.catchByCode('ENOENT'); // bypass ENOENT errors

promise.catchByCode('ENOENT', function (e) {
  // File not found, proceed with alternative strategy:
  ..
}); 

Consider support for multiple codes handling e.g.:

promise.catchByCode({
  ENOENT: null, // bypass
  EMFILE: function (e) {
    // Maximum number of open file descriptors reached...
    ...
  }
}); 
@medikoo medikoo self-assigned this Sep 10, 2015
@medikoo medikoo added this to the v0.8 milestone Sep 10, 2015
@medikoo medikoo closed this as completed Sep 12, 2016
@medikoo medikoo reopened this Sep 12, 2016
@medikoo medikoo closed this as completed Sep 12, 2016
@medikoo medikoo reopened this Sep 12, 2016
@medikoo medikoo closed this as completed Sep 12, 2016
@medikoo medikoo reopened this Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant