Exerosis
12/18/2022, 8:10 AMwithContext(CoroutineExceptionHandler { ... }) {
}
I feel like it's a very confusing system as it is now. If I had to explain it to someone else I would say that uncaught exceptions first try to go up to parent job somehow. Otherwise they look for a CoroutineExceptionHandler falling back on system unhandled exception handler. With runBlocking be a special case that ignores CoroutineExceptionHandler despite being "root". Supervisor scope being another special case where all direct children are "root". Finally you can: CoroutineScope(CoroutineExceptionHandler {}) but it will be overwritten if you provide one to launch.
What is the reason it doesn't just use the context's CoroutineExceptionHandler and have scope constructors add a default handler that delegates to system unhandled? (so every context has a CoroutineExceptionHandler and a Job)
Also is withContext(currentCoroutineContext()) the same as coroutineScope at the end of the day?