Browse Source

Surface exceptions when fetching pages properly (fixes #5377)

arkon 3 years ago
parent
commit
8d25ce7323

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ChapterLoader.kt

@@ -47,6 +47,7 @@ class ChapterLoader(
                 }
             }
             .observeOn(AndroidSchedulers.mainThread())
+            .doOnError { chapter.state = ReaderChapter.State.Error(it) }
             .doOnNext { pages ->
                 if (pages.isEmpty()) {
                     throw Exception(context.getString(R.string.page_list_empty_error))
@@ -61,7 +62,6 @@ class ChapterLoader(
                 }
             }
             .toCompletable()
-            .doOnError { chapter.state = ReaderChapter.State.Error(it) }
     }
 
     /**

+ 0 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt

@@ -87,7 +87,6 @@ class HttpPageLoader(
     override fun getPages(): Observable<List<ReaderPage>> {
         return Observable.fromCallable { chapterCache.getPageListFromCache(chapter.chapter) }
             .onErrorResumeNext { source.fetchPageList(chapter.chapter) }
-            .onErrorReturn { emptyList() }
             .map { pages ->
                 pages.mapIndexed { index, page ->
                     // Don't trust sources and use our own indexing