Wrap write operations in try-catch

This commit is contained in:
Sylwester Zieliński
2023-08-08 12:48:51 +02:00
parent 10f535ba13
commit a15fc7e5ec
4 changed files with 38 additions and 14 deletions

View File

@@ -0,0 +1,9 @@
package no.nordicsemi.android.utils
suspend fun tryOrLog(block: suspend () -> Unit) {
try {
block()
} catch (t: Throwable) {
t.printStackTrace()
}
}