SuspendResult

inline suspend fun <T> SuspendResult(context: CoroutineContext = EmptyCoroutineContext, noinline block: suspend CoroutineScope.() -> T): ApiResult<T>

Run block with a given context, catching any exceptions both in the block and nested coroutines. block will not return until all nested launched coroutines, if any, return. For the other type of behavior, use ApiResult.invoke directly. A failure of a child does not cause the scope to fail and does not affect its other children. A failure of the scope itself (exception thrown in the block or external cancellation) fails the result with all its children, but does not cancel parent job.

See also

supervisorScope
SupervisorJob