Silence Bluebird's unreturned-Promise warning

pull/1/head
Sven Slootweg 5 years ago
parent 876ddc6864
commit 3cd5ff620a

@ -11,12 +11,12 @@ function wrapStreamHandler(stream, handler, callback, item) {
return assureArray(result);
}).each((newItem) => {
stream.push(newItem);
// Silence the "a promise was created in a handler at [...] but was not returned from it" Bluebird warning that occurs in the above; that happens because the `.push` will trigger a *different* wrapped stream's handler (essentially a recursive call), and the Promise that `wrapStreamHandler` creates there is disconnected from this chain. That's not a problem because we use `.nodeify` to wire up the error/completion handling, and so the result of this chain doesn't actually get "lost" like Bluebird thinks.
return null;
}).then(() => {
// TODO: Fix the "a promise was created in a handler at [...] but was not returned from it" Bluebird warning that occurs here
callback();
}).catch((err) => {
callback(err);
});
return;
}).nodeify(callback);
}
module.exports = function stream(handler, flushHandler) {

Loading…
Cancel
Save