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

Implement Is and As for mongo errors

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None
    • None

    Description

      Came up in a recent slack conversation. We should implement Is or As for our custom errors to return true if any of the contained errors match the given error. Other popular drivers seem to follow this pattern to allow users to call errors.Is and errors.As on their custom errors.

      For each error in mongo/errors.go, implement Is to check all possible contained error strings and implement As to cast to any contained error type.

      Attachments

        Activity

          People

            Unassigned Unassigned
            benji.rewis@mongodb.com Benji Rewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: