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

Improve error messaging by wrapping errors in Go Driver 1.x

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown 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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: