[RU]Remanga processing native errors (#1526)
* [RU]Remanga processing native errors * typos
This commit is contained in:
parent
aac281ef87
commit
8870ff3569
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Remanga'
|
||||
extClass = '.Remanga'
|
||||
extVersionCode = 85
|
||||
extVersionCode = 86
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue