diff --git a/core/src/commonMain/kotlin/com/powersync/db/Functions.kt b/core/src/commonMain/kotlin/com/powersync/db/Functions.kt index 77194fd1..4bfd21ad 100644 --- a/core/src/commonMain/kotlin/com/powersync/db/Functions.kt +++ b/core/src/commonMain/kotlin/com/powersync/db/Functions.kt @@ -2,6 +2,7 @@ package com.powersync.db import co.touchlab.kermit.Logger import com.powersync.PowerSyncException +import kotlinx.coroutines.CancellationException public fun runWrapped(block: () -> R): R = try { @@ -20,6 +21,10 @@ public suspend fun runWrappedSuspending(block: suspend () -> R): R = try { block() } catch (t: Throwable) { + if (t is CancellationException) { + throw t + } + if (t is PowerSyncException) { Logger.e("PowerSyncException: ${t.message}") throw t