mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
chore(reader): Adjust error handler
This commit is contained in:
parent
dbdafafba7
commit
76de509ae5
1 changed files with 10 additions and 2 deletions
|
@ -40,6 +40,7 @@ import eu.kanade.tachiyomi.widget.ViewPagerAdapter
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
import kotlinx.coroutines.CancellationException
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Dispatchers.Default
|
import kotlinx.coroutines.Dispatchers.Default
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
|
@ -502,8 +503,15 @@ class PagerPageHolder(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Throwable) {
|
||||||
Logger.e(e) { "Failed to set reader page image" }
|
val logMsg = "Failed to set reader page image"
|
||||||
|
if (e is CancellationException)
|
||||||
|
Logger.w(e) { logMsg } // probably user exiting the reader page before the image loads
|
||||||
|
else
|
||||||
|
Logger.e(e) { logMsg }
|
||||||
|
withUIContext {
|
||||||
|
setError()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue