runCatchingOutcomeOf

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

Executes the block and wraps the result in an Outcome.

Return

A Success with the result of block, or a Failure if an exception occurs.

Parameters

block

The function to execute.


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

Executes the block and wraps the result in an Outcome, using this value as context.

Return

A Success with the result of block, or a Failure if an exception occurs.

Parameters

block

The function to execute.