recoverCatching

inline suspend fun <T> Outcome<T>.recoverCatching(recoverBlock: suspend (Outcome.Failure) -> T): Outcome<T>

Recovers from a Failure by applying the recoverBlock function, catching any exceptions.

Return

The original Success, or a new Success with the recovered value, or a Failure if an exception occurs.

Parameters

recoverBlock

The function to produce a value from a Failure.