Failure

data class Failure<out E : Throwable>(error: E) : Either<Nothing, E>

Failed result with error error.

Parameters

E

Type of the error. It has to extend Throwable.

Constructors

Link copied to clipboard
fun <out E : Throwable> Failure(error: E)

Functions

Link copied to clipboard
open override fun error(): E

Returns the error associated. In case of Success, error will be null.

Link copied to clipboard
open override fun value(): Nothing?

Returns the value associated. In case of Failure, value will be null.

Properties

Link copied to clipboard
val error: E
Link copied to clipboard
val isFailure: Boolean

True if the result is an error, false otherwise.

Link copied to clipboard
val isSuccess: Boolean

True if the result was successful, false otherwise.