Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: Context cancel add to errors #53

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

56KBs
Copy link
Contributor

@56KBs 56KBs commented Nov 17, 2021

When using retry.Context(ctx) where the cancelled context stops the retry loop, add the context to the error log - Unless last error only is set.

This allows for consumers to access the errors that have occurred throughout the retry loop easily.

Technically this is a breaking change as previously it would return the error from the context by default, however now it will return a retry.Error by default.

Fixes #51

When using `retry.Context(ctx)` where the cancelled context stops the retry loop, add the context to the error log - Unless last error only is set.

This allows for consumers to access the errors that have occurred throughout the retry loop easily.
@JaSei
Copy link
Collaborator

JaSei commented Nov 18, 2021

@56KBs thanks to your PR

@JaSei JaSei merged commit b83c899 into avast:master Nov 18, 2021
@56KBs 56KBs deleted the fix/context-cancel-appends-to-error-list branch January 4, 2022 11:38
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.

retry.Context suppresses error attempt log
2 participants