awaitOutcome

suspend fun <T : Any> Deferred<T>.awaitOutcome(): Outcome<T, Throwable>

Awaits the result of a Deferred and wraps it as an Outcome.

If the Deferred completes successfully, the result is wrapped as a Success. If it fails with an exception or is cancelled, the exception is wrapped as a Failure.

Return

An Outcome containing the awaited value or a Failure if an exception occurred.

Parameters

T

The type of the value to await.