Skip to content

Commit

Permalink
Fix retrier nil pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
aalda committed Mar 15, 2019
1 parent eed371b commit 6531835
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion balloon/balloon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func TestQueryConsistencyProof(t *testing.T) {
balloon, err := NewBalloon(store, hashing.NewFakeXorHasher)
require.NoError(t, err)

for j := 0; j <= int(c.addtions); j++ {
for j := 0; j <= int(c.additions); j++ {
_, mutations, err := balloon.Add(util.Uint64AsBytes(uint64(j)))
require.NoErrorf(t, err, "Error adding event %d", j)
store.Mutate(mutations)
Expand Down
4 changes: 2 additions & 2 deletions client/retrier.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ func (r *NoRequestRetrier) DoReq(req *RetriableRequest) (*http.Response, error)
if err == nil && resp.StatusCode > 0 && resp.StatusCode < 500 {
return resp, nil
}
return nil, fmt.Errorf("%s %s returned %d: giving up after %d attempts",
req.Method, req.URL, resp.StatusCode, 1)
return nil, fmt.Errorf("%s %s: giving up after %d attempts",
req.Method, req.URL, 1)
}

// BackoffRequestRetrier is an implementation that uses the given backoff strategy.
Expand Down

0 comments on commit 6531835

Please sign in to comment.