From 653f4273ffc092c5eb6c544a8367457ae263728a Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Mon, 11 Sep 2023 11:55:00 +0600 Subject: [PATCH] fixed: ignore error dialog for 401 --- .../java/foundation/e/apps/data/gplay/utils/GPlayHttpClient.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/foundation/e/apps/data/gplay/utils/GPlayHttpClient.kt b/app/src/main/java/foundation/e/apps/data/gplay/utils/GPlayHttpClient.kt index 38fb0ad22..acb44e965 100644 --- a/app/src/main/java/foundation/e/apps/data/gplay/utils/GPlayHttpClient.kt +++ b/app/src/main/java/foundation/e/apps/data/gplay/utils/GPlayHttpClient.kt @@ -55,6 +55,7 @@ class GPlayHttpClient @Inject constructor( private const val HTTP_TIMEOUT_IN_SECOND = 10L private const val SEARCH = "search" private const val SEARCH_SUGGEST = "searchSuggest" + private const val STATUS_CODE_OK = 200 private const val STATUS_CODE_UNAUTHORIZED = 401 private const val STATUS_CODE_TOO_MANY_REQUESTS = 429 const val STATUS_CODE_TIMEOUT = 408 @@ -206,7 +207,7 @@ class GPlayHttpClient @Inject constructor( } } - if (code != 200) { + if (code !in listOf(STATUS_CODE_OK, STATUS_CODE_UNAUTHORIZED)) { throw GplayHttpRequestException(code, response.message) } -- GitLab