@NonNull open static fun <R : Any!> failure(@NonNull throwable: Throwable): Try<R>
Creates a Failure
from the given Throwable
. This method deliberately allows a null throwable to be passed to conform with rules of monadic design.
throwable
- Throwable: From this Throwable
a Failure
will be created.