Skip to content

Commit ea8d0f6

Browse files
committed
do not fail whole worker
Signed-off-by: alperozturk <[email protected]>
1 parent 79bed04 commit ea8d0f6

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

app/src/main/java/com/nextcloud/client/jobs/offlineOperations/OfflineOperationsWorker.kt

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,22 @@ class OfflineOperationsWorker(
8484

8585
return@withContext try {
8686
for (index in 0..<operations.size) {
87-
val operation = operations[index]
88-
val result = executeOperation(operation, client)
89-
val isSuccess = handleResult(
90-
operation,
91-
totalOperations,
92-
index,
93-
result
94-
)
95-
96-
if (!isSuccess) {
97-
Log_OC.e(TAG, "Offline operation skipped: $operation")
98-
continue
87+
try {
88+
val operation = operations[index]
89+
val result = executeOperation(operation, client)
90+
val isSuccess = handleResult(
91+
operation,
92+
totalOperations,
93+
index,
94+
result
95+
)
96+
97+
if (!isSuccess) {
98+
Log_OC.e(TAG, "Offline operation skipped: $operation")
99+
continue
100+
}
101+
} catch (e: Exception) {
102+
Log_OC.e(TAG, "Offline operation skipped, exception caught: $e")
99103
}
100104
}
101105

0 commit comments

Comments
 (0)