DMZJ: add error message (#16579)

This commit is contained in:
stevenyomi 2023-05-27 04:48:10 +08:00 committed by GitHub
parent 573eb96799
commit ef6318301b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'DMZJ'
pkgNameSuffix = 'zh.dmzj'
extClass = '.Dmzj'
extVersionCode = 39
extVersionCode = 40
}
apply from: "$rootDir/common.gradle"

View File

@ -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()