summaryrefslogtreecommitdiff
path: root/vendor/github.com/cenkalti/backoff/v5/retry.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/cenkalti/backoff/v5/retry.go')
-rw-r--r--vendor/github.com/cenkalti/backoff/v5/retry.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/vendor/github.com/cenkalti/backoff/v5/retry.go b/vendor/github.com/cenkalti/backoff/v5/retry.go
index e43f47fb8..32a7f9883 100644
--- a/vendor/github.com/cenkalti/backoff/v5/retry.go
+++ b/vendor/github.com/cenkalti/backoff/v5/retry.go
@@ -47,7 +47,7 @@ func WithNotify(n Notify) RetryOption {
}
}
-// WithMaxTries limits the number of retry attempts.
+// WithMaxTries limits the number of all attempts.
func WithMaxTries(n uint) RetryOption {
return func(args *retryOptions) {
args.MaxTries = n
@@ -97,7 +97,7 @@ func Retry[T any](ctx context.Context, operation Operation[T], opts ...RetryOpti
// Handle permanent errors without retrying.
var permanent *PermanentError
if errors.As(err, &permanent) {
- return res, err
+ return res, permanent.Unwrap()
}
// Stop retrying if context is cancelled.