Skip to content

TryAgain ignores reraise=True #544

@billnye2

Description

@billnye2

Hello,

First, great library!

I'm running into an issue where I am raising TryAgain, but I am doing this from within an except block. I do this because I am using retry=retry_never so that I can have full control over when Tenacity will retry versus not. I find this pattern easier to understand than using a function passed to the retry kwarg. However, I have noticed that after the last attempt when TryAgain is raised, Tenacity is raising TryAgain itself rather than the underlying exception that it came from. It would be nice if Tenacity here would respect reraise=True and raise the underlying exception itself instead of TryAgain. For now, I think I have found a workaround by subclassing AsyncRetrying and overriding __aiter__ but this seems like a hack.

Let me know your thoughts.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions