data class ErrorOr<out A>
Representation of an operation that may have thrown an error.
<init> |
ErrorOr(value: A) |
error |
val error: Throwable? |
value |
val value: A? |
bind |
fun <B> bind(function: (A) -> ErrorOr<B>): ErrorOr<Nothing> |
combine |
fun <B, C> combine(other: ErrorOr<B>, function: (A, B) -> C): ErrorOr<C> |
getOrThrow |
fun getOrThrow(): A |
map |
fun <B> map(function: (A) -> B): <ERROR CLASS> |
match |
fun <T> match(onValue: (A) -> T, onError: (Throwable) -> T): T |
catch |
fun <T> catch(body: () -> T): ErrorOr<T> Runs the given lambda and wraps the result. |
of |
fun of(t: Throwable): ErrorOr<Nothing> |