From 1767c5a29d0ed06999eb072ab8e0f12325e3c1b9 Mon Sep 17 00:00:00 2001 From: bapeey <90949336+bapeey@users.noreply.github.com> Date: Tue, 15 Oct 2024 01:59:50 -0500 Subject: [PATCH] BlogTruyen: Wrap async call in try-catch (#5526) add try catch --- lib-multisrc/blogtruyen/build.gradle.kts | 2 +- .../eu/kanade/tachiyomi/multisrc/blogtruyen/BlogTruyen.kt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib-multisrc/blogtruyen/build.gradle.kts b/lib-multisrc/blogtruyen/build.gradle.kts index 9dce2478c..e2f11e9c1 100644 --- a/lib-multisrc/blogtruyen/build.gradle.kts +++ b/lib-multisrc/blogtruyen/build.gradle.kts @@ -2,4 +2,4 @@ plugins { id("lib-multisrc") } -baseVersionCode = 2 +baseVersionCode = 3 diff --git a/lib-multisrc/blogtruyen/src/eu/kanade/tachiyomi/multisrc/blogtruyen/BlogTruyen.kt b/lib-multisrc/blogtruyen/src/eu/kanade/tachiyomi/multisrc/blogtruyen/BlogTruyen.kt index 44b932ec4..e32a0dfbe 100644 --- a/lib-multisrc/blogtruyen/src/eu/kanade/tachiyomi/multisrc/blogtruyen/BlogTruyen.kt +++ b/lib-multisrc/blogtruyen/src/eu/kanade/tachiyomi/multisrc/blogtruyen/BlogTruyen.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.multisrc.blogtruyen +import android.util.Log import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.source.model.Filter @@ -366,7 +367,11 @@ abstract class BlogTruyen( ) Single.fromCallable { - client.newCall(request).execute().close() + try { + client.newCall(request).execute().close() + } catch (e: Exception) { + Log.e("BlogTruyen", "Error updating view count", e) + } } .subscribeOn(Schedulers.io()) .observeOn(Schedulers.io())