awaitFault

suspend fun <T : Any> Deferred<T>.awaitFault(): Fault<Throwable>

Awaits the result of a Deferred and wraps it as a Fault.

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

Return

A Fault containing an empty success or a Failure if an exception occurred.

Parameters

T

The type of the value to await.