@@ -299,6 +299,7 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
299
299
private suspend fun uploadContribution (contribution : Contribution ) {
300
300
if (contribution.localUri == null || contribution.localUri.path == null ) {
301
301
Timber .e(""" upload: ${contribution.media.filename} failed, file path is null""" )
302
+ contribution.errorMessage = " genuine failure: file path is null"
302
303
}
303
304
// FP: this is an obvious genuine failure point
304
305
// But the actual return point is not here
@@ -387,6 +388,7 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
387
388
// genuine failure, and if we want a more extensive description then
388
389
// we have those as well
389
390
Timber .e(" Stash Upload failed" )
391
+ contribution.errorMessage = " ambiguous failure: Stash Upload failed"
390
392
showFailedNotification(contribution)
391
393
contribution.state = Contribution .STATE_FAILED
392
394
contribution.chunkInfo = null
@@ -399,6 +401,7 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
399
401
// at least have an exception to work with. And as we have already
400
402
// passed one upload step we can be pretty certain this is not a
401
403
// genuine failure.
404
+ contribution.errorMessage = " failure: upload to stash failed"
402
405
Timber .e(exception)
403
406
Timber .e(" Upload from stash failed for contribution : $filename " )
404
407
showFailedNotification(contribution)
@@ -419,6 +422,7 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
419
422
// This only gives us a failure, nothing more to work with, so can't say it
420
423
// is a genuine failure. This is probably where invalid or missing filename
421
424
// will fail
425
+ contribution.errorMessage = " ambiguous failure: upload to stash failed"
422
426
Timber .e(""" upload file to stash failed with status: ${stashUploadResult.state} """ )
423
427
showFailedNotification(contribution)
424
428
contribution.state = Contribution .STATE_FAILED
@@ -431,6 +435,7 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
431
435
// Ambiguous in the sense that it is hard to determine from code, but we
432
436
// at least have an exception to work with. Might also be here invalid filename
433
437
// fails
438
+ contribution.errorMessage = " failure: upload failed for contribution"
434
439
Timber .e(exception)
435
440
Timber .e(" Stash upload failed for contribution: $filename " )
436
441
showFailedNotification(contribution)
0 commit comments