JVM

The implementation for the JVM looks like this:

internal actual fun handleCoroutineExceptionImpl(
context: CoroutineContext,
exception: Throwable) {

ServiceLoader.load(CoroutineExceptionHandler::class.java)
.forEach { handler ->
handler.handleException(context, exception)
}
val currentThread = Thread.currentThread()

currentThread.uncaughtExceptionHandler
.uncaughtException(currentThread, exception)

}

It looks for exception handlers using the ServiceLoader and forwards the exception to all the ones it can find. It also forwards the exception to the handler of the current thread.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.251.57