From acd18aca9ac43fd9a93923c2f91cdbf7849618a3 Mon Sep 17 00:00:00 2001 From: Ben Adrian Sarmiento Date: Sat, 6 Jul 2024 14:44:32 +0200 Subject: [PATCH] Wrap the error for max retries instead of logging separately --- pkg/http/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/http/client.go b/pkg/http/client.go index 00a4dd4..f8f81f9 100644 --- a/pkg/http/client.go +++ b/pkg/http/client.go @@ -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))