Skip to content

Commit

Permalink
chore(testing): do not emit nil error formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
grayside authored and subfuzion committed Aug 29, 2024
1 parent 6538eba commit e6f0560
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/cloudrunci/cloudrunci.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ func (s *Service) Do(req *http.Request, opts ...func(*RetryOptions)) (*http.Resp
time.Sleep(options.Delay)
}
// Too many attempts, return the last result.
if lastSeen == nil {
return resp, fmt.Errorf("no acceptable response after %d retries", options.MaxAttempts)
}
return resp, fmt.Errorf("no acceptable response after %d retries: %w", options.MaxAttempts, lastSeen)
}

Expand Down

0 comments on commit e6f0560

Please sign in to comment.