From 3b3fe34d22dc06ec08a2d55ab3c3f989f52994f3 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Thu, 17 Sep 2020 11:14:20 -0500 Subject: [PATCH] Don't report Google Drive HTTP 401 or 503 errors --- app/src/main/java/org/tasks/jobs/DriveUploader.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/src/main/java/org/tasks/jobs/DriveUploader.kt b/app/src/main/java/org/tasks/jobs/DriveUploader.kt index 91b9cc9e8..229e771e3 100644 --- a/app/src/main/java/org/tasks/jobs/DriveUploader.kt +++ b/app/src/main/java/org/tasks/jobs/DriveUploader.kt @@ -68,6 +68,21 @@ class DriveUploader @WorkerInject constructor( } catch (e: UnknownHostException) { Timber.e(e) Result.retry() + } catch (e: GoogleJsonResponseException) { + when (e.statusCode) { + 401 -> { + Timber.e(e) + Result.failure() + } + 503 -> { + Timber.e(e) + Result.retry() + } + else -> { + firebase.reportException(e) + Result.retry() + } + } } catch (e: IOException) { firebase.reportException(e) Result.failure()