pull/783/head
gedoor 4 years ago
parent 5d4036ed2f
commit 98fa25fb60
  1. 12
      app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt

@ -93,9 +93,12 @@ object BookChapterList {
for (item in chapterDataList) { for (item in chapterDataList) {
downloadToc( downloadToc(
scope, item, book, bookSource, scope, item, book, bookSource,
tocRule, listRule, chapterList, chapterDataList tocRule, listRule, chapterList, chapterDataList,
{
block.resume(finish(book, chapterList, reverse))
}
) { ) {
block.resume(finish(book, chapterList, reverse)) throw it
} }
} }
} }
@ -114,7 +117,8 @@ object BookChapterList {
listRule: String, listRule: String,
chapterList: ArrayList<BookChapter>, chapterList: ArrayList<BookChapter>,
chapterDataList: ArrayList<ChapterData<String>>, chapterDataList: ArrayList<ChapterData<String>>,
onFinish: () -> Unit onFinish: () -> Unit,
onError: (error: Throwable) -> Unit
) { ) {
Coroutine.async(scope = scope) { Coroutine.async(scope = scope) {
val nextBody = AnalyzeUrl( val nextBody = AnalyzeUrl(
@ -142,7 +146,7 @@ object BookChapterList {
} }
} }
}.onError { }.onError {
throw it onError.invoke(it)
} }
} }

Loading…
Cancel
Save