Skip to content

Allow retry_if_exception_message to specify regex flags #436

@ryancausey

Description

@ryancausey

Currently, the implementation of retry_if_exception_message accepts a regular expression pattern in the match argument. This gets passed to re.compile and used to perform a match against the exception message.

However, since the argument is a regular expression pattern and not a re.Pattern object, users are unable to specify any of the regular expression flags. For example, one cannot pass re.IGNORECASE to specify case-insensitive matching.

A proposed solution is to allow someone to pass an already compiled regular expression, a re.Pattern object, into the match argument so the caller has full control of the regular expression used, including flags.

Relates to:

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