mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-23 17:34:28 +01:00
Wrap write operations in try-catch
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package no.nordicsemi.android.utils
|
||||
|
||||
suspend fun tryOrLog(block: suspend () -> Unit) {
|
||||
try {
|
||||
block()
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user