Skip to content

Commit

Permalink
fix: eachAsync - Treat reject() as a Promise rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach Smith committed Dec 6, 2017
1 parent 7b42c15 commit 9897aaf
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('User\'s @fn called reject() (without an error).')); });
} else {
callback(null);
}
Expand Down

0 comments on commit 9897aaf

Please sign in to comment.