mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 11:28:22 +00:00
Save logs when there's a error using content provider
This commit is contained in:
@@ -444,7 +444,20 @@ class SignerProvider : ContentProvider() {
|
||||
else -> null
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(Amber.TAG, "Error from $callingPackage $uri", e)
|
||||
scope.launch {
|
||||
LocalPreferences.allSavedAccounts(context!!).forEach { accInfo ->
|
||||
val database = Amber.instance.getDatabase(accInfo.npub)
|
||||
database.applicationDao().insertLog(
|
||||
LogEntity(
|
||||
0,
|
||||
packageName,
|
||||
uri.toString().replace("content://$appId.", ""),
|
||||
e.message ?: "Error from $callingPackage $uri",
|
||||
System.currentTimeMillis(),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user