io.paymenthighway.sdk.util / Result / Failure

Failure

data class Failure<out E> : Result<Nothing, E>

Operation failed and returned an associated Exception

Parameters

error - exception associated to the failed operation

Constructors

<init>

Failure(error: E)

Operation failed and returned an associated Exception

Properties

error

val error: E

exception associated to the failed operation

Inherited Properties

isError

val isError: Boolean

Returns true if the result is a failure

isSuccess

val isSuccess: Boolean

Returns true if the result is a success

Inherited Functions

getErrorOrNull

fun getErrorOrNull(): E?

Returns the associated exception error of type E if operation encountered a failure, otherwise null

getOrThrow

fun getOrThrow(): V

Returns the associated value of type V if operation was successful, otherwise throws the failure exception

getValueOrNull

fun getValueOrNull(): V?

Returns the associated value of type V if operation was successful, otherwise null