orThrow

open fun orThrow(): T

Returns the result value in case of Success, otherwise throws an exception related to the error.

Return

The result value in case of Success.

Throws

If the result is Error.