@@ -300,6 +300,7 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
300
300
if (contribution.localUri == null || contribution.localUri.path == null ) {
301
301
Timber .e(""" upload: ${contribution.media.filename} failed, file path is null""" )
302
302
}
303
+ // FP: this is an obvious genuine failure point
303
304
304
305
val media = contribution.media
305
306
val displayTitle = contribution.media.displayTitle
@@ -377,6 +378,7 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
377
378
showSuccessNotification(contribution)
378
379
379
380
} else {
381
+ // FP: Here is a much more ambiguous failure point
380
382
Timber .e(" Stash Upload failed" )
381
383
showFailedNotification(contribution)
382
384
contribution.state = Contribution .STATE_FAILED
@@ -385,6 +387,9 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
385
387
386
388
}
387
389
}catch (exception : Exception ){
390
+ // FP: Exception in upload from stash.
391
+ // Ambiguous in the sense that it is hard to determine from code, but we
392
+ // at least have an exception to work with
388
393
Timber .e(exception)
389
394
Timber .e(" Upload from stash failed for contribution : $filename " )
390
395
showFailedNotification(contribution)
@@ -401,6 +406,8 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
401
406
contributionDao.saveSynchronous(contribution)
402
407
}
403
408
else -> {
409
+ // FP: Error in upload to stash.
410
+ // have a stashUploadResult to work with
404
411
Timber .e(""" upload file to stash failed with status: ${stashUploadResult.state} """ )
405
412
showFailedNotification(contribution)
406
413
contribution.state = Contribution .STATE_FAILED
@@ -409,6 +416,9 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
409
416
}
410
417
}
411
418
}catch (exception: Exception ){
419
+ // FP: Exception in upload to stash.
420
+ // Ambiguous in the sense that it is hard to determine from code, but we
421
+ // at least have an exception to work with
412
422
Timber .e(exception)
413
423
Timber .e(" Stash upload failed for contribution: $filename " )
414
424
showFailedNotification(contribution)
0 commit comments