Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3086

Add a method to ServerError that returns all error codes

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • 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?

      We frequently need to detect not merely whether a given error code exists in a server error, but whether any other errors of concern have happened. To do this it would be good to have a way to gather all error codes from an error. The driver provides HasErrorCode(), but that only checks for a specific, given error code; it won't tell me what other codes the error may contain.

      Right now we've got our own function to do this, but this seems like the kind of thing that the driver would more usefully provide—not the least because it's unclear from the documentation whether there are other types of server errors that we're not checking.

      It might be useful to consider this in tandem with GODRIVER-3048, which proposes additional parsing of MultipleErrorsOccurred errors.

            Assignee:
            Unassigned Unassigned
            Reporter:
            felipe.gasper@mongodb.com Felipe Gasper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: