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

Sometimes callback would never be called #16

Open
eight04 opened this issue Dec 26, 2019 · 2 comments
Open

Sometimes callback would never be called #16

eight04 opened this issue Dec 26, 2019 · 2 comments

Comments

@eight04
Copy link

eight04 commented Dec 26, 2019

return Promise.reject(new TypeError('expected the first argument to be a string'));

This error should be passed to the callback.

@doowb
Copy link
Collaborator

doowb commented Dec 27, 2019

Can you provide some example code with a case where this is causing a bug?

If so, a PR with a fix for the bug will be welcome.

@eight04
Copy link
Author

eight04 commented Dec 27, 2019

Assumes the user is using "async callback" API:

const deleteEmpty = require("delete-empty");

const path = undefined; // assumes the input is wrong

const onDone = (err, result) => console.log("finished", err, result);

try {
  deleteEmpty(path, onDone);
} catch (err) {
  console.log("err", err);
}

You will get an unhandled promise. REPL

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

2 participants