Skip to content

Comments

retry: always include last operation error on timeout or context cancel#182

Open
cenkalti wants to merge 1 commit intov5from
outcomes
Open

retry: always include last operation error on timeout or context cancel#182
cenkalti wants to merge 1 commit intov5from
outcomes

Conversation

@cenkalti
Copy link
Owner

@cenkalti cenkalti commented Feb 21, 2026

Summary

  • Retry now returns errors.Join(context.Cause(ctx), lastErr) when the context is cancelled, ensuring the last operation error is always available alongside the context error.
  • Retry now returns errors.Join(context.DeadlineExceeded, lastErr) when WithMaxElapsedTime is exceeded, making timeout behaviour consistent regardless of whether the deadline comes from the context or WithMaxElapsedTime.

Closes #181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ambigiuty between MaxElapsedTime and context's deadline

1 participant