Fix Glide exceptions
Cette révision appartient à :
Parent
10e1106760
révision
cf293642fb
2 fichiers modifiés avec 18 ajouts et 7 suppressions
|
@ -57,13 +57,17 @@ open class App : Application() {
|
|||
}
|
||||
|
||||
protected open fun setupJobManager() {
|
||||
JobManager.create(this).addJobCreator { tag ->
|
||||
when (tag) {
|
||||
LibraryUpdateJob.TAG -> LibraryUpdateJob()
|
||||
UpdaterJob.TAG -> UpdaterJob()
|
||||
BackupCreatorJob.TAG -> BackupCreatorJob()
|
||||
else -> null
|
||||
try {
|
||||
JobManager.create(this).addJobCreator { tag ->
|
||||
when (tag) {
|
||||
LibraryUpdateJob.TAG -> LibraryUpdateJob()
|
||||
UpdaterJob.TAG -> UpdaterJob()
|
||||
BackupCreatorJob.TAG -> BackupCreatorJob()
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Timber.w("Can't initialize job manager")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.network
|
|||
|
||||
import com.squareup.duktape.Duktape
|
||||
import okhttp3.*
|
||||
import java.io.IOException
|
||||
|
||||
class CloudflareInterceptor : Interceptor {
|
||||
|
||||
|
@ -19,7 +20,13 @@ class CloudflareInterceptor : Interceptor {
|
|||
|
||||
// Check if Cloudflare anti-bot is on
|
||||
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
|
||||
|
|
Référencer dans un nouveau ticket