-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(NODE-2035): exceptions thrown from awaited cursor forEach do not propagate #2835
fix(NODE-2035): exceptions thrown from awaited cursor forEach do not propagate #2835
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job finding the fix, some clean up and its looking pretty much ready
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
In addition to the changes in the afterEach hook, I think the test's readability would be improved by being rewritten using async/await instead of Promise syntax, now that it's available to use in driver v4. Totally up to you whether to do that though, the test LGTM otherwise.
70959d9
to
f19b463
Compare
Rebased onto 4.0 |
test/functional/cursor.test.js
Outdated
expect.fail('Error in forEach call not caught'); | ||
}) | ||
.catch(err => { | ||
console.log(err.message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra console log, otherwise LGTM :)
Description
Catch and propagate exceptions in awaited cursor.forEach
What changed?