Skip to content

Commit 68ebafb

Browse files
committed
fix(rn-android): catch all exception
1 parent ef5b932 commit 68ebafb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/async-storage/android/src/main/kotlin/org/asyncstorage/storage/PersistentStorage.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import kotlinx.coroutines.SupervisorJob
1212
import kotlinx.coroutines.launch
1313
import kotlinx.coroutines.plus
1414
import org.asyncstorage.shared_storage.SharedStorage
15-
import org.asyncstorage.shared_storage.StorageException
1615

1716
private val createStorageScope = { name: String ->
1817
CoroutineScope(SupervisorJob() + CoroutineName(name))
@@ -69,10 +68,8 @@ private fun <T> CoroutineScope.lunchWithRejection(promise: Promise, block: suspe
6968
block()
7069
} catch (e: CancellationException) {
7170
throw e
72-
} catch (e: StorageException) {
73-
promise.reject(code = "AsyncStorageException", message = e.message, throwable = e)
7471
} catch (e: Exception) {
75-
promise.reject(e)
72+
promise.reject(code = "AsyncStorageException", message = e.message, throwable = e)
7673
}
7774
}
7875
}

0 commit comments

Comments
 (0)