Skip to content

Commit c0c728a

Browse files
committed
fixed integration test issues
1 parent 402bf42 commit c0c728a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

retry/retry.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func Retry(ctx context.Context, op retryOperation, opts ...retryOption) (err err
162162
}
163163

164164
if ctxErr := ctx.Err(); ctxErr != nil {
165-
return xerrors.WithStackTrace(xerrors.Errorf("retry failed on attempt No.%d: %w", ctx.Err()))
165+
return xerrors.WithStackTrace(xerrors.Errorf("retry failed on attempt No.%d: %w", attempts, ctx.Err()))
166166
}
167167

168168
m := Check(err)
@@ -172,12 +172,12 @@ func Retry(ctx context.Context, op retryOperation, opts ...retryOption) (err err
172172
}
173173

174174
if !m.MustRetry(options.idempotent) {
175-
return xerrors.WithStackTrace(xerrors.Errorf("retry failed on attempt No.%d: %w", err))
175+
return xerrors.WithStackTrace(xerrors.Errorf("retry failed on attempt No.%d: %w", attempts, err))
176176
}
177177

178178
if e := wait.Wait(ctx, options.fastBackoff, options.slowBackoff, m.BackoffType(), i); e != nil {
179179
return xerrors.WithStackTrace(
180-
xerrors.Errorf("retry failed on attempt No.%d: wait exit with error '%w' (origin error '%w')", e, err),
180+
xerrors.Errorf("retry failed on attempt No.%d: wait exit with error '%w' (origin error '%w')", attempts, e, err),
181181
)
182182
}
183183

0 commit comments

Comments
 (0)