m3x icon indicating copy to clipboard operation
m3x copied to clipboard

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

Open jeromefroe opened this issue 8 years ago • 0 comments

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.

jeromefroe avatar Sep 07 '17 02:09 jeromefroe