From 2723aeeb5c47585bc9ac1ca762c6f7d7dbcaf495 Mon Sep 17 00:00:00 2001 From: len Date: Fri, 3 Jun 2016 12:37:07 +0200 Subject: [PATCH] Better error feedback. Closes #325 --- .../eu/kanade/tachiyomi/data/source/online/OnlineSource.kt | 3 +++ .../main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 2 +- app/src/main/res/values/strings.xml | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/OnlineSource.kt b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/OnlineSource.kt index 0c8780098..fb1325a2c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/OnlineSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/OnlineSource.kt @@ -261,6 +261,9 @@ abstract class OnlineSource(context: Context) : Source { .newCall(pageListRequest(chapter)) .asObservable() .map { response -> + if (!response.isSuccessful) { + throw Exception("Webpage sent ${response.code()} code") + } mutableListOf().apply { pageListParse(response, this) if (isEmpty()) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 853ec7141..15f6e7205 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -222,7 +222,7 @@ class ReaderActivity : BaseRxActivity() { fun onChapterError(error: Throwable) { Timber.e(error, error.message) finish() - toast(R.string.page_list_error) + toast(error.message) } fun onChapterAppendError() { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 55d4e71f5..1d8f621e0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -252,7 +252,6 @@ Downloading… Downloaded %1$d%% Page: %1$d - Error fetching page list. Check your internet connection. Chapter %1$s Next chapter not found Previous chapter not found