Skip to content

Commit b220a72

Browse files
committed
Improve error handling
1 parent f0c2761 commit b220a72

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/src/main/java/com/phpbg/easysync/worker/MediastoreIdSyncWorker.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import androidx.work.OneTimeWorkRequestBuilder
3333
import androidx.work.WorkManager
3434
import androidx.work.WorkerParameters
3535
import com.phpbg.easysync.mediastore.MediaStoreService
36+
import com.phpbg.easysync.util.toDavFile
3637

3738
private const val TAG = "MediastoreIdSyncWorker"
3839
private const val DATA_ID_KEY = "id"
@@ -57,7 +58,7 @@ class MediastoreIdSyncWorker(appContext: Context, workerParams: WorkerParameters
5758
val syncService = SyncService.getInstance(this.applicationContext)
5859
val mediaStoreService = MediaStoreService(this.applicationContext)
5960
val file = mediaStoreService.getById(id)
60-
if (file== null) {
61+
if (file == null) {
6162
Log.d(TAG, "No entry in mediastore for $id")
6263
return Result.success()
6364
}
@@ -74,7 +75,7 @@ class MediastoreIdSyncWorker(appContext: Context, workerParams: WorkerParameters
7475
// We don't mind too many errors: file will be synced anyway with periodic full sync worker
7576
Result.retry()
7677
} else {
77-
syncService.handleWorkerException(applicationContext, e, file.relativePath)
78+
syncService.handleWorkerException(applicationContext, e, file.toDavFile().getPath())
7879
Result.failure()
7980
}
8081
}

0 commit comments

Comments
 (0)