mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 01:51:51 +01:00
Fix Glide exceptions
This commit is contained in:
parent
10e1106760
commit
cf293642fb
@ -57,6 +57,7 @@ open class App : Application() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected open fun setupJobManager() {
|
protected open fun setupJobManager() {
|
||||||
|
try {
|
||||||
JobManager.create(this).addJobCreator { tag ->
|
JobManager.create(this).addJobCreator { tag ->
|
||||||
when (tag) {
|
when (tag) {
|
||||||
LibraryUpdateJob.TAG -> LibraryUpdateJob()
|
LibraryUpdateJob.TAG -> LibraryUpdateJob()
|
||||||
@ -65,6 +66,9 @@ open class App : Application() {
|
|||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Timber.w("Can't initialize job manager")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun setupNotificationChannels() {
|
protected open fun setupNotificationChannels() {
|
||||||
|
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.network
|
|||||||
|
|
||||||
import com.squareup.duktape.Duktape
|
import com.squareup.duktape.Duktape
|
||||||
import okhttp3.*
|
import okhttp3.*
|
||||||
|
import java.io.IOException
|
||||||
|
|
||||||
class CloudflareInterceptor : Interceptor {
|
class CloudflareInterceptor : Interceptor {
|
||||||
|
|
||||||
@ -19,7 +20,13 @@ class CloudflareInterceptor : Interceptor {
|
|||||||
|
|
||||||
// Check if Cloudflare anti-bot is on
|
// Check if Cloudflare anti-bot is on
|
||||||
if (response.code() == 503 && response.header("Server") in serverCheck) {
|
if (response.code() == 503 && response.header("Server") in serverCheck) {
|
||||||
return chain.proceed(resolveChallenge(response))
|
return try {
|
||||||
|
chain.proceed(resolveChallenge(response))
|
||||||
|
} catch (e: Exception) {
|
||||||
|
// Because OkHttp's enqueue only handles IOExceptions, wrap the exception so that
|
||||||
|
// we don't crash the entire app
|
||||||
|
throw IOException(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
Loading…
Reference in New Issue
Block a user