Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

[errors] Replace all calls to fmt.Errorf with errors.Wrap and errors.Wrapf #96

Open
jeromefroe opened this issue Sep 7, 2017 · 0 comments

Comments

@jeromefroe
Copy link
Contributor

As noted in #94 wrapping errors with fmt.Errorf, i.e.

if err != nil {
  return fmt.Errorf("context about error: %v" err)
}

loses the type information of the error which is being wrapped. Consequently, we should audit the m3db codebases to replace all calls to fmt.Errorf with calls to errors.Wrap and errors.Wrapf. For the longer term, it may be worthwhile to add a custom linter for issues specific to repos under the m3db organization to the gometalinter suite and include this issue as one of the lints.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant