mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-21 01:21:34 -08:00
Capture exception in IO action task
This commit is contained in:
1 parent
7e7ab4ce19
commit
4bb366b568
1 file changed
+6
-1
@@ -34,7 +34,12 @@ class IOActionTask<T>(
|
||||
mainScope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
val asyncResult: Deferred<T?> = async {
|
||||
action.invoke()
|
||||
try {
|
||||
action.invoke()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
afterActionDatabaseListener?.invoke(asyncResult.await())
|
||||
|
||||
Reference in new issue
Block a user