runCatchingCancelable
Like runCatching, but rethrows CancellationException to preserve structured concurrency. All other exceptions are captured in the Result.
Return
A Result containing the block's value or the captured exception.
Parameters
block
The block to execute.