fail With
Type safe way of throwing an exception.
Return the value of the success case or throws the exception from the "onFailure" block. This acts as a bridge to the standard kotlin.Result.
infix inline fun <R, E : Exception, R2, E2 : Exception> Result<R2, E2>.failWith(block: (E2) -> E): R2
Return the value of the success case or fail with the exception returned from the "block" block.