From e7da953deaeeeaf914ca3b252217b5cd920e0b68 Mon Sep 17 00:00:00 2001 From: Rafael Dantas Justo Date: Tue, 6 Jan 2026 16:05:13 -0300 Subject: [PATCH] Fix: HTTP - Exponential Backoff - Expose error after reaching all attempts When reaching the maximum number of attempts, the error should be exposed to the caller. --- httputilx/httputilx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httputilx/httputilx.go b/httputilx/httputilx.go index f8adef4..c135bde 100644 --- a/httputilx/httputilx.go +++ b/httputilx/httputilx.go @@ -245,7 +245,7 @@ func DoExponentialBackoff(req *http.Request, options ...ExponentialBackoffOption resp, err := o.client.Do(reqClone) if !o.shouldRetry(resp, err) || attempt >= o.maxRetries { - return resp, nil + return resp, err } logArgs := []any{