Skip to content
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-6276): preserve top level error code MongoWriteConcernError #4183

Merged
merged 5 commits into from
Jul 26, 2024

Conversation

aditi-khare-mongoDB
Copy link
Contributor

@aditi-khare-mongoDB aditi-khare-mongoDB commented Jul 25, 2024

Description

Preserve top level error code MongoWriteConcernError

What is changing?

Ensure that MongoWriteConcernError is correctly formed such that the original top-level code is preserved

  • If no top-level code exists, MongoWriteConcernError.code should be set to the nested code
  • If a top-level code is passed into the constructor, it shouldn't be changed or overwritten by the nested writeConcernError.code
Is there new documentation needed for these changes?

No

What is the motivation for this change?

Bug fix

Release Highlight

MongoWriteConcernError.code is overwritten by nested code within MongoWriteConcernError.result.writeConcernError.code

MongoWriteConcernError is now correctly formed such that the original top-level code is preserved

  • If no top-level code exists, MongoWriteConcernError.code should be set to MongoWriteConcernError.result.writeConcernError.code
  • If a top-level code is passed into the constructor, it shouldn't be changed or overwritten by the nested writeConcernError.code

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@aditi-khare-mongoDB aditi-khare-mongoDB force-pushed the NODE-6276/MongoWriteConcernError-bug-fix branch from 96d4362 to 355f05d Compare July 25, 2024 22:07
@aditi-khare-mongoDB aditi-khare-mongoDB marked this pull request as ready for review July 26, 2024 15:59
@baileympearson baileympearson self-assigned this Jul 26, 2024
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jul 26, 2024
@aditi-khare-mongoDB aditi-khare-mongoDB force-pushed the NODE-6276/MongoWriteConcernError-bug-fix branch from d03a2b5 to 10a6629 Compare July 26, 2024 17:04
@baileympearson baileympearson merged commit e902584 into main Jul 26, 2024
25 of 29 checks passed
@baileympearson baileympearson deleted the NODE-6276/MongoWriteConcernError-bug-fix branch July 26, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants