[RU]Remanga processing native errors (#1526)

* [RU]Remanga processing native errors

* typos
This commit is contained in:
Eshlender 2024-02-25 20:33:05 +05:00 committed by Draff
parent aac281ef87
commit 8870ff3569
2 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Remanga'
extClass = '.Remanga'
extVersionCode = 85
extVersionCode = 86
}
apply from: "$rootDir/common.gradle"

View File

@ -171,7 +171,12 @@ class Remanga : ConfigurableSource, HttpSource() {
val originalRequest = chain.request()
val response = chain.proceed(originalRequest)
if (originalRequest.url.toString().contains(exManga) and !response.isSuccessful) {
throw IOException("HTTP error ${response.code}. Домен ${exManga.substringAfter("//")} сервиса ExManga недоступен, выберите другой в настройках ⚙️ расширения")
val errorText = json.decodeFromString<ExWrapperDto<String>>(response.body.string()).data
if (errorText.isEmpty()) {
throw IOException("HTTP error ${response.code}. Домен ${exManga.substringAfter("//")} сервиса ExManga недоступен, выберите другой в настройках ⚙️ расширения")
} else {
throw IOException("HTTP error ${response.code}. ExManga: $errorText")
}
}
response
}