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

enleur

12/03/2018, 12:46 PM
should I define empty error handler to avoid this? https://pl.kotl.in/Bk5wBif1N
g

gildor

12/03/2018, 1:48 PM
No, error handler will not help
This is expected behavior
CoroutineSope child coroutine failed, this cause scope cancellation and propagation of error (because block finished exceptionally)
This behavior is default to avoid coroutines leaking: if one of child coroutines failed, it causes cancellation of scope and all other child coroutines
You can wrap code inside of runBlocking to supervisorContext to prevent scope from cancellation and propagation of error, but you responsible now to handle other coroutines manually
e

enleur

12/03/2018, 2:30 PM
thanks