I have a supervisor that launches some children coroutines
supervisorScope {
aListOfJobs.forEach { job -> launch(handler) { process(job) } }
}
}
Where handler is some callback to handle the thrown exceptions from the children coroutines.
val handler = CoroutineExceptionHandler { _, exception ->
// for some exceptions I should allow the parent job to continue, and others I should not and trigger the cancellation of my parent
}
It seems that even when the handler throws an exception (i.e. i rethrow the received exception), the supervisor is not cancelled.
So my question is, what is the idiomatic way to allow the supervisor to continue working for some exceptions, but not others?