Throw WriteConcernError from InsertOneOperation when `writeErrors` is present

XMLWordPrintableJSON

    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Use Case

      As a driver user,
      I want the WriteConcernError to be used consistently in the driver,
      So that I can rely on the error types to determine the class of error I received.

      User Experience

      • Users might be confused as to why their insert one write concern errors are not instanceof WriteConcernError.

      Dependencies

      • n/a

      Risks/Unknowns

      • none

      Acceptance Criteria

      Implementation Requirements

      • Modify insert operations, update operations and delete operatoins to throw WriteConcernErrors instead of a MongoServerError when writeErrors is present in the command response.

      (look for throw new MongoServerError(res.writeErrors[0]))

      Testing Requirements

      • Confirm all existing tests pass.
      • Add tests demonstrating a WriteConcernError is thrown from insertOne()

      Documentation Requirements

      • n/a

      Follow Up Requirements

      • n/a

              Assignee:
              Unassigned
              Reporter:
              Bailey Pearson
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: