Replace fmt.Errorf with errors.Errorf#3627
Conversation
campoy
left a comment
There was a problem hiding this comment.
Reviewed 5 of 50 files at r1.
Reviewable status: 5 of 50 files reviewed, 3 unresolved discussions (waiting on @campoy, @danielmai, and @martinmr)
conn/pool.go, line 39 at r2 (raw file):
ErrNoConnection = errors.Errorf("No connection exists") // ErrUnhealthyConnection indicates the connection to a node is unhealthy. ErrUnhealthyConnection = errors.Errorf("Unhealthy connection")
These should be errors.New technically ... but I don't think it matters much, tbh
dgraph/cmd/alpha/http.go, line 108 at r2 (raw file):
uintVal, err := strconv.ParseUint(value, 0, 64) if err != nil { return 0, errors.Errorf("Error: %+v while parsing %s as uint64", err, name)
These should be replaced with errors.Wrapf(err, "could not parse %q as unit64", name)
And same for all the other fmt.Errorf which embed an error.
martinmr
left a comment
There was a problem hiding this comment.
Reviewable status: 4 of 50 files reviewed, 3 unresolved discussions (waiting on @campoy, @danielmai, and @golangcibot)
conn/pool.go, line 39 at r2 (raw file):
Previously, campoy (Francesc Campoy) wrote…
These should be
errors.Newtechnically ... but I don't think it matters much, tbh
Just changed this since they are typed errors. I left the rest as-is.
dgraph/cmd/alpha/http.go, line 108 at r2 (raw file):
Previously, campoy (Francesc Campoy) wrote…
These should be replaced with
errors.Wrapf(err, "could not parse %q as unit64", name)And same for all the other
fmt.Errorfwhich embed an error.
Done.
dgraph/cmd/migrate/table_guide.go, line 24 at r1 (raw file):
Previously, golangcibot (Bot from GolangCI) wrote…
File is not
gofmt-ed with-s(fromgofmt)
Done.
campoy
left a comment
There was a problem hiding this comment.
Reviewed 44 of 50 files at r1, 1 of 1 files at r2, 22 of 22 files at r3.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @campoy, @danielmai, and @golangcibot)
Fixes #3449
This change is