Skip to content

Commit

Permalink
Merge pull request #5875 from ZacharyRSmith/fix/eachAsync
Browse files Browse the repository at this point in the history
fix: eachAsync - Treat reject() as a Promise rejection (gh-5874)
  • Loading branch information
vkarpov15 authored Dec 10, 2017
2 parents e2e38e5 + 580b2d5 commit 2ecf938
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/services/cursor/eachAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = function eachAsync(next, fn, options, callback) {
if (promise && typeof promise.then === 'function') {
promise.then(
function() { callback(null); },
function(error) { callback(error); });
function(error) { callback(error || new Error('`eachAsync()` promise rejected without error')); });
} else {
callback(null);
}
Expand Down

0 comments on commit 2ecf938

Please sign in to comment.