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: Fixed
    • Priority: Icon: Unknown Unknown
    • 2.1.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Fully Compatible
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      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:
            preston.vasquez@mongodb.com Preston Vasquez
            Reporter:
            felipe.gasper@mongodb.com Felipe Gasper
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None