runCatchingOutcomeBlock

inline suspend fun <T> runCatchingOutcomeBlock(block: suspend () -> Outcome<T>): Outcome<T>

Executes the block that returns an Outcome, catching any exceptions.

Return

The Outcome from block, or a Failure if an exception occurs.

Parameters

block

The function that returns an Outcome.


inline suspend fun <T> T.runCatchingOutcomeBlock(block: suspend () -> Outcome<T>): Outcome<T>

Executes the block that returns an Outcome, using this value as context, catching any exceptions.

Return

The Outcome from block, or a Failure if an exception occurs.

Parameters

block

The function that returns an Outcome.