https://kotlinlang.org logo
#coroutines
Title
# coroutines
l

Lukas Lechner

10/28/2020, 2:32 PM
Hi! I created a “Kotlin Coroutines Exception Handling Cheat Sheet”. It might be helpful 👉 https://www.lukaslechner.com/coroutines-exception-handling-cheat-sheet/
👍 11
n

Nick

10/28/2020, 2:39 PM
This is helpful, thanks!!
1
e

Erik

10/29/2020, 6:58 AM
Thanks. One question about example 3: Coroutine 1 fails and propagates the exception up the hierarchy. SupervisorJob is a sibling of Coroutine 1. Shouldn't it be cancelled exceptionally in this example (and all its children too)?
If so, I suggest that you make this clear in the example. I understand that you want to point out that a supervisor doesn't cancel sibling children on sibling failure, but a supervisor can be cancelled!
So, to improve the example, maybe make the root scope a supervisor
However, that would make the cancellation of the entire hierarchy (if no supervisor parent) unclear. So really this needs two examples
8 Views