I’m having some trouble on how to design something...
# coroutines
a
I’m having some trouble on how to design something with coroutines: I want to do multiple tasks in parallel, but if one of them throws I want to stop all the other ones (putting them in the same coroutineScope seems to do that properly) but I also want to be able to catch any error thrown by the coroutine in the function that launched them (this part is the one I’m struggling with)
s
a
Thank you! Seems like the solutions might be to use async or a supervisorJob!
e
Just put
try { ... } catch
around the
coroutineScope { ... }
that launches all your coroutines.
👍 1