sdk-common / com.tomtom.online.sdk.common.functional / Try / failure

failure

@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.

Parameters

throwable - Throwable: From this Throwable a Failure will be created.

- Type of the stored value.

Return
Try<R>: instance of Failure.