failure

fun <T> failure(exception: WrappedException, metadata: Map<String, Any?> = emptyMap()): EncodableResult<T>
fun <T> failure(exception: Throwable, metadata: Map<String, Any?> = emptyMap()): EncodableResult<T>

Creates a new EncodableResult instance representing a failure.

Return

A new EncodableResult instance representing a failure.

Parameters

exception

The exception to be wrapped in the result.

metadata

Optional metadata to be associated with the result.