We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27bc461 commit a1e1efaCopy full SHA for a1e1efa
retry.go
@@ -113,10 +113,10 @@ func Do(retryableFunc RetryableFunc, opts ...Option) error {
113
select {
114
case <-config.timer.After(delay(config, n, err)):
115
case <-config.context.Done():
116
- if !config.wrapContextErrorWithLastError {
117
- return config.context.Err()
+ if config.wrapContextErrorWithLastError {
+ return fmt.Errorf("%w: %w", config.context.Err(), lastErr)
118
}
119
- return fmt.Errorf("%w: %w", config.context.Err(), lastErr)
+ return config.context.Err()
120
121
122
0 commit comments