delete-empty icon indicating copy to clipboard operation
delete-empty copied to clipboard

Sometimes callback would never be called

Open eight04 opened this issue 6 years ago • 2 comments

https://github.com/jonschlinkert/delete-empty/blob/6ae34547663e6845c3c98b184c606fa90ef79c0a/index.js#L50

This error should be passed to the callback.

eight04 avatar Dec 26 '19 20:12 eight04

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.

doowb avatar Dec 27 '19 16:12 doowb

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

eight04 avatar Dec 27 '19 18:12 eight04