Surface exceptions when fetching pages properly (fixes #5377)

This commit is contained in:
arkon 2021-06-12 10:49:30 -04:00
parent 8deca3b63a
commit 8d25ce7323
2 changed files with 1 additions and 2 deletions

View file

@ -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) }
}
/**

View file

@ -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