Better error feedback. Closes #325

This commit is contained in:
len 2016-06-03 12:37:07 +02:00
parent 728ab18017
commit 2723aeeb5c
3 changed files with 4 additions and 2 deletions

View file

@ -261,6 +261,9 @@ abstract class OnlineSource(context: Context) : Source {
.newCall(pageListRequest(chapter)) .newCall(pageListRequest(chapter))
.asObservable() .asObservable()
.map { response -> .map { response ->
if (!response.isSuccessful) {
throw Exception("Webpage sent ${response.code()} code")
}
mutableListOf<Page>().apply { mutableListOf<Page>().apply {
pageListParse(response, this) pageListParse(response, this)
if (isEmpty()) { if (isEmpty()) {

View file

@ -222,7 +222,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
fun onChapterError(error: Throwable) { fun onChapterError(error: Throwable) {
Timber.e(error, error.message) Timber.e(error, error.message)
finish() finish()
toast(R.string.page_list_error) toast(error.message)
} }
fun onChapterAppendError() { fun onChapterAppendError() {

View file

@ -252,7 +252,6 @@
<string name="downloading">Downloading…</string> <string name="downloading">Downloading…</string>
<string name="download_progress">Downloaded %1$d%%</string> <string name="download_progress">Downloaded %1$d%%</string>
<string name="chapter_progress">Page: %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="chapter_subtitle">Chapter %1$s</string>
<string name="no_next_chapter">Next chapter not found</string> <string name="no_next_chapter">Next chapter not found</string>
<string name="no_previous_chapter">Previous chapter not found</string> <string name="no_previous_chapter">Previous chapter not found</string>