recoverable

fun Retry?.recoverable(throwableClass: Class<out Throwable>): RecoverableType

Determines recoverable type considering Retry annotation configuration.

This function evaluates the recoverable type of an exception class in the context of a Retry annotation. The Retry annotation can mark exceptions, including assignable superclasses, as recoverable or unrecoverable, overriding the default classifications.

Priority order:

  1. Nearest assignable type in retry.recoverable or retry.unrecoverable

  2. Recoverable match when both lists match at the same distance

  3. Default classification for the exception class when neither list matches

Return

the recoverable type considering retry configuration

Parameters

throwableClass

the exception class to evaluate

See also


Determines the recoverable type of this Throwable.

This property checks if the exception can be recovered through retry mechanisms by examining the exception's class hierarchy and any registered classifications.

See also


Determines the default recoverable type for this exception class.

This property provides default recoverable classifications based on the exception class hierarchy. It first checks for explicit registrations, then applies default rules for known recoverable exception types.

Default classifications:

  • Exceptions implementing RecoverableException → RECOVERABLE

  • TimeoutException and subclasses → RECOVERABLE

  • All others → UNKNOWN

Return

the recoverable type classification for this exception class

See also