Wrap the error for max retries instead of logging separately
This commit is contained in:
@@ -185,7 +185,7 @@ func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) {
|
||||
if incr > 0 {
|
||||
attempt += incr
|
||||
if attempt > r.maxRetries {
|
||||
r.log.Warnf("Request to %s failed after %d attempts", req.URL.String(), r.maxRetries)
|
||||
err = fmt.Errorf("max retries exceeded: %w", err)
|
||||
break
|
||||
}
|
||||
time.Sleep(r.backoff(attempt))
|
||||
|
||||
Reference in New Issue
Block a user