awaitError

suspend fun <T> ReceiveChannel<T>.awaitError(name: String? = null): Throwable

Assert that attempting to read from the ReceiveChannel yields an exception, indicating that it was closed with an exception.

Throws

if the next event was an item or completion.