Details
-
Improvement
-
Resolution: Unresolved
-
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.