recover

open infix suspend fun <E, A> Effect<E, A>.recover(resolve: suspend Raise<R>.(E) -> A): A


open infix fun <E, A> EagerEffect<E, A>.recover(resolve: Raise<R>.(E) -> A): A

See also


open suspend fun <E, A> Effect<E, A>.recover(action: suspend Raise<E>.() -> A, recover: suspend Raise<R>.(E) -> A, catch: suspend Raise<R>.(Throwable) -> A): A

Execute the Effect resulting in A, and recover from any logical error of type E, and Throwable, by providing a fallback value of type A, or raising a new error of type R.

See also

if you don't need to recover from Throwable.