From 9675111870d9ce3747d056a4bfdb41ad8e209a55 Mon Sep 17 00:00:00 2001 From: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> Date: Fri, 27 Jan 2023 17:07:21 -0300 Subject: [PATCH] Fix Tappytoon crash. (#15148) --- src/all/tappytoon/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/all/tappytoon/Tappytoon.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/all/tappytoon/build.gradle b/src/all/tappytoon/build.gradle index 0857e2ab0..16d38399c 100644 --- a/src/all/tappytoon/build.gradle +++ b/src/all/tappytoon/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Tappytoon' pkgNameSuffix = 'all.tappytoon' extClass = '.TappytoonFactory' - extVersionCode = 6 + extVersionCode = 7 isNsfw = true } diff --git a/src/all/tappytoon/src/eu/kanade/tachiyomi/extension/all/tappytoon/Tappytoon.kt b/src/all/tappytoon/src/eu/kanade/tachiyomi/extension/all/tappytoon/Tappytoon.kt index 9320d1caf..57bf2a8cf 100644 --- a/src/all/tappytoon/src/eu/kanade/tachiyomi/extension/all/tappytoon/Tappytoon.kt +++ b/src/all/tappytoon/src/eu/kanade/tachiyomi/extension/all/tappytoon/Tappytoon.kt @@ -19,6 +19,7 @@ import okhttp3.Request import okhttp3.Response import okhttp3.ResponseBody.Companion.toResponseBody import uy.kohesive.injekt.injectLazy +import java.io.IOException import java.text.SimpleDateFormat import java.util.Calendar import java.util.Locale @@ -45,11 +46,11 @@ class Tappytoon(override val lang: String) : HttpSource() { // Throw JSON error if available if (mime == "application/json") { res.body?.string()?.let(json::parseToJsonElement)?.run { - throw Error(jsonObject["message"]!!.jsonPrimitive.content) + throw IOException(jsonObject["message"]!!.jsonPrimitive.content) } } res.close() - throw Error("HTTP error ${res.code}") + throw IOException("HTTP error ${res.code}") }.build() private val json by injectLazy()