From d1c956401cfc8c0dcce68a2134ae97927ac2c678 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 18 Aug 2023 22:28:14 -0400 Subject: [PATCH] =?UTF-8?q?Add=20documentation=20for=20HttpException?= =?UTF-8?q?=E2=80=A8=20Corresponds=20with=20https://github.com/tachiyomior?= =?UTF-8?q?g/extensions-lib/pull/12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt b/core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt index 240f64a92..4cbb34812 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt @@ -143,4 +143,11 @@ fun decodeFromJsonResponse( } } +/** + * Exception that handles HTTP codes considered not successful by OkHttp. + * Use it to have a standardized error message in the app across the extensions. + * + * @since extensions-lib 1.5 + * @param code [Int] the HTTP status code + */ class HttpException(val code: Int) : IllegalStateException("HTTP error $code")