getOrElseOrRethrowCancellation

suspend fun <T> Result<T>.getOrElseOrRethrowCancellation(onFailure: (Throwable) -> T): T

Return

the encapsulated value or calls onFailure, but rethrows if the failure is the cancellation of the current coroutine.