Skip to content

Commit 108ddc1

Browse files
committed
Treat nested EOFException as transient
1 parent 1420010 commit 108ddc1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

core/src/main/java/org/calyxos/seedvault/core/backends/webdav/WebDavBackend.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@ public class WebDavBackend(
361361
return true
362362
} else if (e is EOFException && e.message?.contains("\\n not found") == true) {
363363
return true
364+
} else if (e is IOException && e.cause is EOFException &&
365+
e.message?.contains("\\n not found") == true
366+
) {
367+
return true
368+
} else if (e is IOException && e.message?.contains("unexpected end of stream") == true) {
369+
return true
364370
}
365371
return false
366372
}

storage/lib/src/main/java/org/calyxos/backup/storage/api/StorageBackup.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ public class StorageBackup(
191191
if (checkRunning.get() || !backupRunning.compareAndSet(false, true)) {
192192
Log.w(TAG, "Backup or check already running, not starting a new one")
193193
return@withContext false
194+
} else {
195+
Log.i(TAG, "Backup started, running set.")
194196
}
195197
try {
196198
backup.runBackup(backupObserver)

0 commit comments

Comments
 (0)