getOrElse

fun getOrElse(onFailure: (WrappedException) -> T): T

Returns the value if it is present, otherwise invokes the specified function onFailure and returns its result.

Return

the value if present, otherwise the result of invoking onFailure

Parameters

onFailure

a function that takes a WrappedException and returns a value of type T