Rob
07/27/2025, 4:34 PMBrais Gabin
07/27/2025, 4:43 PMRob
07/27/2025, 4:47 PMSebastian Schuberth
07/27/2025, 7:04 PMSebastian Schuberth
07/27/2025, 7:09 PMRob
07/27/2025, 7:11 PMrunCatching
everywhere. I wanted a more flexible option that makes sure we check for cancellation if there is a suspend call inside a catching block.Sebastian Schuberth
07/27/2025, 7:14 PMRob
07/27/2025, 8:16 PMCoroutineCancellation
. It requires calling ensureActive()
in the catch block or onFailure instead of other work arounds.
That is what was recommended by @elizarov in this thread.Rob
07/27/2025, 8:20 PMRob
07/27/2025, 8:21 PMSebastian Schuberth
07/28/2025, 9:45 AMif (e is CancellationException)
pattern as explained here?Sebastian Schuberth
07/28/2025, 9:56 AMcurrentCoroutineContext().ensureActive()
.Rob
07/28/2025, 1:04 PMensureActive()
?Sebastian Schuberth
07/28/2025, 1:35 PMThe pattern withoutisn't in line with the prompt cancellation guarantee that a lot of our functions give.if (e is CancellationException)
Rob
07/28/2025, 1:36 PM