Skip to content

Promise.reject() without an arg should be treated as a Promise rejection #5874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ZacharyRSmith opened this issue Dec 6, 2017 · 1 comment
Milestone

Comments

@ZacharyRSmith
Copy link

Do you want to request a feature or report a bug?

bug

What is the current behavior?

eachAsync does not recognize fn calling reject() without an arg as a Promise rejection.

If the current behavior is a bug, please provide the steps to reproduce.

const cursor = Model.find({}).cursor();
const fn = new Promise((resolve, reject) => reject());
cursor.eachAsync(fn, err => {
  console.log('err', err); // undefined
});

What is the expected behavior?

Calling reject() should be treated as a Promise rejection.

Please mention your node.js, mongoose and MongoDB version.

node.js: >=6.11.4
mongoose: 4.13.7-pre
MongoDB: 3.2.7

vkarpov15 added a commit that referenced this issue Dec 10, 2017
fix: eachAsync - Treat reject() as a Promise rejection (gh-5874)
@vkarpov15 vkarpov15 added this to the 4.13.7 milestone Dec 10, 2017
@vkarpov15
Copy link
Collaborator

Fixed by #5875

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants