From 9eace89d4fe957937fe35c8347022fb543b33754 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Mon, 14 Aug 2023 09:44:02 +0300 Subject: [PATCH] Update error messages --- app/build.gradle | 2 +- .../main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt | 2 ++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index c2c9e7ab8..f67525d49 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -101,7 +101,7 @@ dependencies { implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.3.1' implementation 'androidx.viewpager2:viewpager2:1.1.0-beta02' - implementation 'androidx.preference:preference-ktx:1.2.0' + implementation 'androidx.preference:preference-ktx:1.2.1' implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha05' implementation 'com.google.android.material:material:1.9.0' implementation 'androidx.lifecycle:lifecycle-common-java8:2.6.1' diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt index abafc3db7..0a369f99f 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt @@ -14,6 +14,7 @@ import org.koitharu.kotatsu.core.exceptions.CaughtException import org.koitharu.kotatsu.core.exceptions.CloudFlareProtectedException import org.koitharu.kotatsu.core.exceptions.EmptyHistoryException import org.koitharu.kotatsu.core.exceptions.SyncApiException +import org.koitharu.kotatsu.core.exceptions.TooManyRequestExceptions import org.koitharu.kotatsu.core.exceptions.UnsupportedFileException import org.koitharu.kotatsu.core.exceptions.WrongPasswordException import org.koitharu.kotatsu.parsers.exception.AuthRequiredException @@ -32,6 +33,7 @@ fun Throwable.getDisplayMessage(resources: Resources): String = when (this) { is UnsupportedOperationException, -> resources.getString(R.string.operation_not_supported) + is TooManyRequestExceptions -> resources.getString(R.string.too_many_requests_message) is UnsupportedFileException -> resources.getString(R.string.text_file_not_supported) is FileNotFoundException -> resources.getString(R.string.file_not_found) is AccessDeniedException -> resources.getString(R.string.no_access_to_file) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d9118894b..3793a2119 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -473,4 +473,5 @@ Unknown In progress Disable NSFW + Too many requests. Try again later