onFailureRethrowCancellation

Like Result.onFailure, but rethrows CancellationException to preserve coroutine cancellation.

Extension function on Result.

Return

this Result

Parameters

action

the action to invoke on non-cancellation failures

Type Parameters

T

the result type

Throws

CancellationException

if the failure is a cancellation exception