Surface exceptions when fetching pages properly (fixes #5377)

(cherry picked from commit 8d25ce732307f2aee41f40a5a3c656458863f0da)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ChapterLoader.kt
This commit is contained in:
arkon 2021-06-12 10:49:30 -04:00 committed by Jobobby04
parent 03c45f676a
commit d04161cc9e
2 changed files with 1 additions and 2 deletions

View File

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

View File

@ -98,7 +98,6 @@ class HttpPageLoader(
override fun getPages(): Observable<List<ReaderPage>> { override fun getPages(): Observable<List<ReaderPage>> {
return Observable.fromCallable { chapterCache.getPageListFromCache(chapter.chapter) } return Observable.fromCallable { chapterCache.getPageListFromCache(chapter.chapter) }
.onErrorResumeNext { source.fetchPageList(chapter.chapter) } .onErrorResumeNext { source.fetchPageList(chapter.chapter) }
.onErrorReturn { emptyList() }
.map { pages -> .map { pages ->
// SY --> // SY -->
val rp = pages.mapIndexed { index, page -> val rp = pages.mapIndexed { index, page ->