Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3337

Simplify the handleWriteConcernError code in bulk/common.ts

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Not Needed

      Use Case

      As a... node driver developer
      I want... straightforward code without multiple levels of error wrapping
      So that... I can be confident that the error objects are exactly what they need to be when returned to the user

      Dependencies

      • None

      Unknowns

      • What attributes are actually required on the error object that are currently added via the multiple levels of wrapping

      Acceptance Criteria

      • Simplify the handleWriteConcernError code in bulk/common.ts
        • There is a write concern error wrapped in 4 levels of constructors; reduce the number of calls to MongoServerError
        • If successful, it should be possible to also remove the plain Error type from the constructor definition for MongoServerError;
          • this is desirable because the MongoServerError should be a wrapper for error documents returned from the server, not our own errors
      Implementation Requirements
      • There should not be any breaking changes
      Testing Requirements
      • All existing tests should pass
      • Add an explicit test for the required shape of the resulting error
      Documentation Requirements
      • None
      Follow Up Requirements
      • None

            Assignee:
            andy.mina@mongodb.com Andy Mina
            Reporter:
            daria.pardue@mongodb.com Daria Pardue
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: