RecoverableExceptionRegistrar

Global registry that maps exception classes to their RecoverableType classifications.

On initialization, it uses ServiceLoader to discover all RecoverableExceptionProvider implementations on the classpath and delegates registration to each one. The backing store is a ConcurrentHashMap, so registration and lookup are thread-safe.

The registry is consulted by the Class.recoverable extension property when determining whether an exception can be retried. Explicit registrations here take precedence over the default rules (e.g., RecoverableException marker interface, TimeoutException).

See also

Functions

Link copied to clipboard

Returns the registered RecoverableType for the given exception class, or null if no registration exists.

Link copied to clipboard
fun register(throwableClass: Class<out Throwable>, recoverableType: RecoverableType)

Registers (or overwrites) the RecoverableType for the given exception class.

Link copied to clipboard
fun unregister(throwableClass: Class<out Throwable>)

Removes the registration for the given exception class.