diff --git a/library/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt b/library/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt index a99da7e..6c4e2a3 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt @@ -9,3 +9,12 @@ fun Call.asObservable(): Observable = throw Exception("Stub!") fun Call.asObservableSuccess(): Observable = throw Exception("Stub!") suspend fun Call.await(): Response = throw Exception("Stub!") + +/** + * 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")