Skip to content

Commit a06f040

Browse files
add exception helper
1 parent e3996e7 commit a06f040

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* Fixed `CrudBatch` `hasMore` always returning false.
66
* Added `triggerImmediately` to `onChange` method.
7+
* [Internal] Added helper method for Swift `PowerSyncException` throwing.
78

89
## 1.0.0-BETA32
910

core/src/commonMain/kotlin/com/powersync/PowerSyncException.kt

+13
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,16 @@ public class PowerSyncException(
44
message: String,
55
cause: Throwable,
66
) : Exception(message, cause)
7+
8+
9+
/**
10+
* Helper class designed to bridge SKIEE methods and allow them to throw
11+
* `PowerSyncException`. This is necessary because these exceptions cannot
12+
* be thrown directly in Swift.
13+
*
14+
* The class provides a mechanism to handle exceptions in a way that is
15+
* compatible with the Swift environment, ensuring proper error propagation
16+
* and handling.
17+
*/
18+
@Throws(PowerSyncException::class)
19+
public fun throwPowerSyncException(exception: PowerSyncException): Unit = throw exception

0 commit comments

Comments
 (0)