-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: Error Handling
There are a bunch of places we could improve information in errors returned by the Go driver by wrapping errors with additional context. In some cases we can't change errors because it would break backward compatibility (see GODRIVER-2721 for the related Go Driver 2.0 ticket), but in many cases we can wrap errors.
Definition of done:
- Audit errors returned by the Go Driver to find ones that we can change (i.e. we don't promise to return a specific error value) and that we can wrap with additional information.
- Consider using the errrolint linter to check for misuse of the Go 1.13 error wrapping pattern.
- Replace all uses of the internal errutil.WrapErrorf with fmt.Errorf using the "%w" verb.
- Consider copying the Go stdlib errors.Join code into the errutil package to support multi-errors.
- is related to
-
GODRIVER-3440 Add selected server info to error messages
- Needs Triage
-
GODRIVER-2721 Fully support "errors.Is" and "errors.As" in all stable public APIs
- Backlog
-
GODRIVER-2775 Remove the "replaceErrors" function
- Backlog
- related to
-
GODRIVER-2932 Timeout errors that occur while starting a change stream are confusing and non-deterministic
- Backlog
-
GODRIVER-2941 Should we account for driver.WriteCommandError in mongo.replaceErrors ?
- Backlog
-
GODRIVER-3031 Errors on retryable ops should indicate originating server when possible
- Closed