expectError

infix fun <V, E> Result<V, E>.expectError(message: String): E


infix inline fun <V, E> Result<V, E>.expectError(message: () -> Any): E

Unwraps a Result, yielding the error.

Parameters

message

The message to include in the UnwrapException if the Result is Ok.

Throws