CoroutineExceptionHandler not executed when provided as launch context
问题 When I run this: fun f() = runBlocking { val eh = CoroutineExceptionHandler { _, e -> trace("exception handler: $e") } val j1 = launch(eh) { trace("launched") delay(1000) throw RuntimeException("error!") } trace("joining") j1.join() trace("after join") } f() This is output: [main @coroutine#1]: joining [main @coroutine#2]: launched java.lang.RuntimeException: error! at ExceptionHandling$f9$1$j1$1.invokeSuspend(ExceptionHandling.kts:164) at kotlin.coroutines.jvm.internal.BaseContinuationImpl