Skip to content

Commit 889be07

Browse files
committed
fix(shared-storage): annotate methods as throwing
1 parent c9e8b82 commit 889be07

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

shared-storage/src/appleMain/kotlin/org/asyncstorage/shared_storage/database/DatabaseFiles.apple.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import kotlinx.cinterop.*
44
import org.asyncstorage.shared_storage.PlatformContext
55
import platform.Foundation.*
66

7+
@Throws(IllegalStateException::class, IllegalArgumentException::class)
78
actual fun DatabaseFiles.Companion.of(
89
context: PlatformContext,
910
databaseName: String,

shared-storage/src/commonMain/kotlin/org/asyncstorage/shared_storage/SharedStorage.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.asyncstorage.shared_storage
22

3+
import kotlinx.coroutines.CancellationException
34
import kotlinx.coroutines.flow.Flow
45

56
/**
@@ -10,18 +11,25 @@ import kotlinx.coroutines.flow.Flow
1011
*/
1112
interface SharedStorage {
1213

14+
@Throws(StorageException::class, CancellationException::class)
1315
suspend fun getValues(keys: List<String>): List<Entry>
1416

17+
@Throws(StorageException::class)
1518
fun getValuesFlow(keys: List<String>): Flow<List<Entry>>
1619

20+
@Throws(StorageException::class, CancellationException::class)
1721
suspend fun setValues(entries: List<Entry>): List<Entry>
1822

23+
@Throws(StorageException::class, CancellationException::class)
1924
suspend fun removeValues(keys: List<String>)
2025

26+
@Throws(StorageException::class, CancellationException::class)
2127
suspend fun getKeys(): List<String>
2228

29+
@Throws(StorageException::class)
2330
fun getKeysFlow(): Flow<List<String>>
2431

32+
@Throws(StorageException::class, CancellationException::class)
2533
suspend fun clear()
2634
}
2735

0 commit comments

Comments
 (0)