Skip to content

Add support for inspecting exception causes in @Retry #1794

@leonard84

Description

@leonard84

Is your feature request related to a problem?

Sometimes the exception that you want to actually want to look at is the cause of the top-level exception. For example if the exception happened in a condition you get a ConditionFailedWithExceptionError which is fairly unspecific.

Describe the solution you'd like

Either always expect causes, or add a flag to inspect them when configured.

@Retry (
    exceptions = StaleElementReferenceException,
    inspectCauses = true
)

Describe alternatives you've considered

@Retry (
    exceptions = [StaleElementReferenceException, ConditionFailedWithExceptionError],
    // exceptions don't check causes, so we need to do it in the condition
    condition = {
        failure instanceof StaleElementReferenceException || failure.cause instanceof StaleElementReferenceException
    }
)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions