Error

data class Error(val exception: ColibrioException) : ColibrioResult<Nothing>

Represents an error result holding exception of type ColibrioException

Constructors

Link copied to clipboard
constructor(exception: ColibrioException)

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Returns the encapsulated value if this ColibrioResult is ColibrioResult.Success or null if it is a ColibrioResult.Error

Link copied to clipboard
fun onError(action: (exception: ColibrioException) -> Unit): ColibrioResult<Nothing>

Performs the given action on the encapsulated ColibrioException exception if this instance is ColibrioResult.Error. Returns the original ColibrioResult unchanged.

Link copied to clipboard
suspend fun onErrorSuspend(action: suspend (exception: ColibrioException) -> Unit): ColibrioResult<Nothing>

Performs the given suspend action on the encapsulated ColibrioException exception if this instance is ColibrioResult.Error. Returns the original ColibrioResult unchanged.

Link copied to clipboard

Performs the given action on the encapsulated data if this instance is ColibrioResult.Success. Returns the original ColibrioResult unchanged.

Link copied to clipboard
suspend fun onSuccessSuspend(action: suspend (Nothing) -> Unit): ColibrioResult<Nothing>

Performs the given suspend action on the encapsulated data if this instance is ColibrioResult.Success. Returns the original ColibrioResult unchanged.