Surface exceptions when fetching pages properly (fixes #5377)
This commit is contained in:
parent
8deca3b63a
commit
8d25ce7323
2 changed files with 1 additions and 2 deletions
|
@ -47,6 +47,7 @@ class ChapterLoader(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.doOnError { chapter.state = ReaderChapter.State.Error(it) }
|
||||||
.doOnNext { pages ->
|
.doOnNext { 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))
|
||||||
|
@ -61,7 +62,6 @@ class ChapterLoader(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.toCompletable()
|
.toCompletable()
|
||||||
.doOnError { chapter.state = ReaderChapter.State.Error(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -87,7 +87,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 ->
|
||||||
pages.mapIndexed { index, page ->
|
pages.mapIndexed { index, page ->
|
||||||
// Don't trust sources and use our own indexing
|
// Don't trust sources and use our own indexing
|
||||||
|
|
Reference in a new issue