Skip to content

Improve error handling for context timeout in Do #122

@iamsli

Description

@iamsli

Current Behavior
The Do function returns the context timeout error when the context times out, which obscures the actual error that caused the retries to fail.

Desired Behavior
When the context times out,Do should return the last error encountered during the retry attempts, rather than the context timeout error. This will provide more meaningful information about the root cause of the failure.

Proposed Solution
Modify the Do function to store the last non-context error encountered and return it if the context times out.

This is possibly debatable behavior so definitely up for discussion :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions