ribesg
02/25/2021, 10:10 AMCoroutineScope(Dispatchers.Default + CoroutineExceptionHandler { _, e ->
log.error("Uncaught error in scope", e)
})
But it looks like when an error occurs, or rather after a few errors, coroutines basically stop like if the scope was dead or something. Eveyrthing seems stuck. Does calling the CoroutineExceptionHandler cancel the scope’s job or something? Do I need to specify a + SupervisorJob()
when building the scope? I don’t really understand what’s happeningkrzysztof
02/25/2021, 11:01 AMJob()
behavior - when error occurs, parent cancel child jobs and propagates error up (until scope reached). When that happens (and scope is cancelled) you no longer can use it.
And yes, using SupervisorJob replaces that behavior - it’ll not cancel other children and stop error propagationribesg
02/25/2021, 1:01 PMJob
and not a SupervisorJob
by defaultlouiscad
02/25/2021, 9:45 PMMainScope()
will use a SupervisorJob
though.