From dcb3166e0700cdf3f1f75fece9056e951e5c95d6 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Wed, 13 Oct 2021 17:41:33 +0300 Subject: [PATCH] Handle exceptions on K/N by invoking 'processUnhandledException' --- .../native/src/CoroutineExceptionHandlerImpl.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/native/src/CoroutineExceptionHandlerImpl.kt b/kotlinx-coroutines-core/native/src/CoroutineExceptionHandlerImpl.kt index 7fedbd9fac..d97743b4bf 100644 --- a/kotlinx-coroutines-core/native/src/CoroutineExceptionHandlerImpl.kt +++ b/kotlinx-coroutines-core/native/src/CoroutineExceptionHandlerImpl.kt @@ -5,12 +5,14 @@ package kotlinx.coroutines import kotlin.coroutines.* +import kotlin.native.* internal actual fun initializeDefaultExceptionHandlers() { // Do nothing } +@OptIn(ExperimentalStdlibApi::class) internal actual fun handleCoroutineExceptionImpl(context: CoroutineContext, exception: Throwable) { // log exception - exception.printStackTrace() + processUnhandledException(exception) }