mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-17 12:49:19 +01:00
Surface exceptions when fetching pages properly (fixes #5377)
This commit is contained in:
parent
8deca3b63a
commit
8d25ce7323
@ -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) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user