@@ -301,6 +301,8 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
301
301
Timber .e(""" upload: ${contribution.media.filename} failed, file path is null""" )
302
302
}
303
303
// FP: this is an obvious genuine failure point
304
+ // But the actual return point is not here
305
+ // So I guess we can just add a var here which basically says what the string above say
304
306
305
307
val media = contribution.media
306
308
val displayTitle = contribution.media.displayTitle
@@ -379,6 +381,11 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
379
381
380
382
} else {
381
383
// FP: Here is a much more ambiguous failure point
384
+ // Either uploadResult is null in which case we have a big problem
385
+ // or we'll have some form of message in uploadResult.result
386
+ // Either way we can probably not confidently say that it is a
387
+ // genuine failure, and if we want a more extensive description then
388
+ // we have those as well
382
389
Timber .e(" Stash Upload failed" )
383
390
showFailedNotification(contribution)
384
391
contribution.state = Contribution .STATE_FAILED
@@ -389,7 +396,9 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
389
396
}catch (exception : Exception ){
390
397
// FP: Exception in upload from stash.
391
398
// Ambiguous in the sense that it is hard to determine from code, but we
392
- // at least have an exception to work with
399
+ // at least have an exception to work with. And as we have already
400
+ // passed one upload step we can be pretty certain this is not a
401
+ // genuine failure.
393
402
Timber .e(exception)
394
403
Timber .e(" Upload from stash failed for contribution : $filename " )
395
404
showFailedNotification(contribution)
@@ -407,7 +416,9 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
407
416
}
408
417
else -> {
409
418
// FP: Error in upload to stash.
410
- // have a stashUploadResult to work with
419
+ // This only gives us a failure, nothing more to work with, so can't say it
420
+ // is a genuine failure. This is probably where invalid or missing filename
421
+ // will fail
411
422
Timber .e(""" upload file to stash failed with status: ${stashUploadResult.state} """ )
412
423
showFailedNotification(contribution)
413
424
contribution.state = Contribution .STATE_FAILED
@@ -418,7 +429,8 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
418
429
}catch (exception: Exception ){
419
430
// FP: Exception in upload to stash.
420
431
// Ambiguous in the sense that it is hard to determine from code, but we
421
- // at least have an exception to work with
432
+ // at least have an exception to work with. Might also be here invalid filename
433
+ // fails
422
434
Timber .e(exception)
423
435
Timber .e(" Stash upload failed for contribution: $filename " )
424
436
showFailedNotification(contribution)
0 commit comments