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

Wrap socket.authorizationError in connect.ts with a MongoError subclass

    • Type: Icon: Improvement Improvement
    • Resolution: Gone away
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Error
    • Labels:
    • Not Needed
    • 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?

      Description

      We should wrap the raw NodeJS Error passed to the callback in a MongoError subclass. This instance of a NodeJS Error being propagated was missed in the implementation of the driver error overhaul (NODE-3292).

      Acceptance Criteria

      Implementation Requirements

      • Wrap the socket.authorizationError provided to the callback with a MongoError subclass (which one is most appropriate is TBD in this ticket)
      • Investigate updating the Callback utility type to accept MongoError as its optional error argument instead of AnyError and consider deprecating/completely removing the AnyError type in the driver.
        • Note: There are only ~10 errors caused across the driver by changing the definition of the Callback utility type.
      • remove cast to MongoError in createConnection method in connection_pool.ts

            Assignee:
            Unassigned Unassigned
            Reporter:
            warren.james@mongodb.com Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: