Better error feedback. Closes #325
This commit is contained in:
parent
728ab18017
commit
2723aeeb5c
@ -261,6 +261,9 @@ abstract class OnlineSource(context: Context) : Source {
|
||||
.newCall(pageListRequest(chapter))
|
||||
.asObservable()
|
||||
.map { response ->
|
||||
if (!response.isSuccessful) {
|
||||
throw Exception("Webpage sent ${response.code()} code")
|
||||
}
|
||||
mutableListOf<Page>().apply {
|
||||
pageListParse(response, this)
|
||||
if (isEmpty()) {
|
||||
|
@ -222,7 +222,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
||||
fun onChapterError(error: Throwable) {
|
||||
Timber.e(error, error.message)
|
||||
finish()
|
||||
toast(R.string.page_list_error)
|
||||
toast(error.message)
|
||||
}
|
||||
|
||||
fun onChapterAppendError() {
|
||||
|
@ -252,7 +252,6 @@
|
||||
<string name="downloading">Downloading…</string>
|
||||
<string name="download_progress">Downloaded %1$d%%</string>
|
||||
<string name="chapter_progress">Page: %1$d</string>
|
||||
<string name="page_list_error">Error fetching page list. Check your internet connection.</string>
|
||||
<string name="chapter_subtitle">Chapter %1$s</string>
|
||||
<string name="no_next_chapter">Next chapter not found</string>
|
||||
<string name="no_previous_chapter">Previous chapter not found</string>
|
||||
|
Loading…
Reference in New Issue
Block a user