getOrDefault

fun <VALUE> Result<VALUE>.getOrDefault(defaultValue: VALUE): VALUE

Returns the encapsulated value if this instance represents Success or defaultValue for encapsulated exception if it is Error.

If Error.error is CancellationException then this error is rethrown.