From ef6318301b2bfe6270dcf222186819cddcc9b6f2 Mon Sep 17 00:00:00 2001 From: stevenyomi <95685115+stevenyomi@users.noreply.github.com> Date: Sat, 27 May 2023 04:48:10 +0800 Subject: [PATCH] DMZJ: add error message (#16579) --- src/zh/dmzj/build.gradle | 2 +- .../dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV3.kt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/zh/dmzj/build.gradle b/src/zh/dmzj/build.gradle index 080436573..cdb498bb0 100644 --- a/src/zh/dmzj/build.gradle +++ b/src/zh/dmzj/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'DMZJ' pkgNameSuffix = 'zh.dmzj' extClass = '.Dmzj' - extVersionCode = 39 + extVersionCode = 40 } apply from: "$rootDir/common.gradle" diff --git a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV3.kt b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV3.kt index 46603e8d9..be5b63bed 100644 --- a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV3.kt +++ b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/ApiV3.kt @@ -26,7 +26,11 @@ object ApiV3 { fun mangaInfoUrlV1(id: String) = "$apiUrl/dynamic/comicinfo/$id.json" - private fun parseMangaInfoV1(response: Response): ResponseDto = response.parseAs() + private fun parseMangaInfoV1(response: Response): ResponseDto = try { + response.parseAs() + } catch (_: Throwable) { + throw Exception("获取漫画信息失败") + } fun parseMangaDetailsV1(response: Response): SManga { return parseMangaInfoV1(response).data.info.toSManga()