From a557a052f6701e7bf32b49e67f4cc3a430f1b78b Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sun, 29 Dec 2024 18:47:01 +0100 Subject: [PATCH] note about blocks note that 403 nay be returned both when user is blocked and when app was no authorized different actions should be taken in both cases - if user gave no necessary oauth permission, then app should attempt log-in if user was blocked, then appropriate message should be shown especially in case of zero-hour blocks just relogging in may apparently swallow the attempted communication --- .../de/westnordost/streetcomplete/data/ApiClientExceptions.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/ApiClientExceptions.kt b/app/src/main/java/de/westnordost/streetcomplete/data/ApiClientExceptions.kt index b489eefa597..f7118d24d5e 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/ApiClientExceptions.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/ApiClientExceptions.kt @@ -34,6 +34,7 @@ inline fun wrapApiClientExceptions(block: () -> T): T = throw ConnectionException(e.message, e) } // authorization is something we can handle (by requiring (re-)login of the user) + // note that user may be also blocked, this may require special handling HttpStatusCode.Forbidden, HttpStatusCode.Unauthorized -> { throw AuthorizationException(e.message, e) }