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

MongoSystemError objects should have a `code` property if the server sends back an error code.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.4.1
    • Affects Version/s: None
    • Component/s: None
    • 3
    • Not Needed

      What problem are you facing?

      Error handling in change streams relies on the error codes that are return in MongoSystemError objects.  The current constructor of MongoSystemErrors is structured in such a way that the error code is stored in an object on the error and not as a top level property.  This means that error handling code does not have access to the error code and for change streams.

      Acceptance Criteria

      • Store the `code` on the MongoSystemError as a top level property

      Potential Additional Acceptance Criteria

      • Many errors do not have tests associated with them.  Convert the error.test.js tests to Typescript and add tests for any missing errors.
      • There may be other errors that should propagate the `code` key as well.  We could fix any errors that have a `code` as a part of this ticket.

       

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            bailey.pearson@mongodb.com Bailey Pearson
            Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: