From 7fffa1173dbc0c4d58b7bb81bc35313857b935c3 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Wed, 13 Oct 2021 23:24:56 +0300 Subject: [PATCH] Handle exceptions on K/N by invoking 'processUnhandledException' (#2981) --- .../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) }