Hi! I am using DataStore for Kotlin multiplatform. But to handle errors I need to receive java.io.IOException
which is Android dependent. Is there any way to do error handling without depending on Multiplatform?
Copy code
try {
dataStore.edit { preferences ->
preferences[idKey] = value
}
} catch (e: IOException) {
Timber.e(e, "Failed to store $idKey $value")
}
r
russhwolf
05/25/2023, 4:24 PM
DataStore defines a
androidx.datastore.core.IOException
in common which typaliases to
java.io.IOException
on JVM. So if you're not using multiplatform you should be able to use the java type.