Zerobyw: update URL on all HTTP errors (#16171)

This commit is contained in:
stevenyomi 2023-04-26 01:20:00 +08:00 committed by GitHub
parent 6d6c4aa04f
commit 4c13f3836b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Zerobyw'
pkgNameSuffix = 'zh.zerobyw'
extClass = '.Zerobyw'
extVersionCode = 15
extVersionCode = 16
}
apply from: "$rootDir/common.gradle"

View File

@ -11,7 +11,7 @@ import okhttp3.OkHttpClient
import okhttp3.Response
import java.io.IOException
private const val DEFAULT_BASE_URL = "http://www.zerobyw4090.com"
private const val DEFAULT_BASE_URL = "http://www.zerobyw3.com"
private const val BASE_URL_PREF = "ZEROBYW_BASEURL"
private const val DEFAULT_BASE_URL_PREF = "defaultBaseUrl"
@ -78,7 +78,7 @@ class UpdateUrlInterceptor(
val failedResult = try {
val response = chain.proceed(request)
if (response.code < 500) return response
if (response.isSuccessful) return response
Result.success(response)
} catch (e: IOException) {
if (chain.call().isCanceled()) throw e