Fix uncaught throwable with dufs WebDAV server

The underlying issue will affect other functionality though: https://github.com/sigoden/dufs/issues/400
This commit is contained in:
Torsten Grote 2024-06-13 17:44:18 -03:00
parent 56e26083fc
commit 4ac02018fa
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF
2 changed files with 2 additions and 2 deletions

View file

@ -139,7 +139,7 @@ class StoragePluginManager(
suspend fun getFreeSpace(): Long? { suspend fun getFreeSpace(): Long? {
return try { return try {
appPlugin.getFreeSpace() appPlugin.getFreeSpace()
} catch (e: Exception) { } catch (e: Throwable) { // NoClassDefFound isn't an [Exception], can get thrown by dav4jvm
Log.e("StoragePluginManager", "Error getting free space: ", e) Log.e("StoragePluginManager", "Error getting free space: ", e)
null null
} }

View file

@ -163,7 +163,7 @@ internal class WebDavStoragePlugin(
override suspend fun getAvailableBackups(): Sequence<EncryptedMetadata>? { override suspend fun getAvailableBackups(): Sequence<EncryptedMetadata>? {
return try { return try {
doGetAvailableBackups() doGetAvailableBackups()
} catch (e: Exception) { } catch (e: Throwable) { // NoClassDefFound isn't an [Exception], can get thrown by dav4jvm
Log.e(TAG, "Error getting available backups: ", e) Log.e(TAG, "Error getting available backups: ", e)
null null
} }