safeS

open suspend fun <R> safeS(block: suspend T.() -> R): Result<R>(source)

Executes a suspending block on the target, catching any exceptions (except kotlinx.coroutines.CancellationException) and returning a Result.

Return

A Result containing either the successful result or the caught exception

Parameters

block

The suspending operation to execute on the target

Type Parameters

R

The return type of the block