Skip to content

Commit 2ecf938

Browse files
authored
Merge pull request #5875 from ZacharyRSmith/fix/eachAsync
fix: eachAsync - Treat reject() as a Promise rejection (gh-5874)
2 parents e2e38e5 + 580b2d5 commit 2ecf938

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/services/cursor/eachAsync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = function eachAsync(next, fn, options, callback) {
3030
if (promise && typeof promise.then === 'function') {
3131
promise.then(
3232
function() { callback(null); },
33-
function(error) { callback(error); });
33+
function(error) { callback(error || new Error('`eachAsync()` promise rejected without error')); });
3434
} else {
3535
callback(null);
3636
}

0 commit comments

Comments
 (0)