attempt

open suspend fun <E, A> attempt(f: suspend EffectScope<E>.() -> A): suspend EffectScope<E>.() -> A

Deprecated

Use the arrow.core.raise.Raise type instead, which is more general and can be used to and can be used to raise typed errors or _logical failures_ The Raise<R> type is source compatible, a simple find & replace of arrow.core.continuations.* to arrow.core.raise.* will do the trick. Add missing imports and you're good to go!

Replace with

import arrow.core.raise.effect
effect(f)

Encloses an action for which you want to catch any shift. attempt is used in combination with catch.

attempt { ... } catch { ... }

The f may shift into a different EffectScope, giving the chance for a later catch to change the shifted value. This is useful to simulate re-throwing of exceptions.