unwrapError

fun <V, E> Result<V, E>.unwrapError(): E

Unwraps a Result, yielding the error.

Throws

if the Result is Ok, with a message containing the value.