浏览代码

Log message error when a request from the catalogue fails.

inorichi 9 年之前
父节点
当前提交
50b97fa28f

+ 4 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java

@@ -49,6 +49,7 @@ import nucleus.factory.RequiresPresenter;
 import rx.Subscription;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.subjects.PublishSubject;
+import timber.log.Timber;
 
 @RequiresPresenter(CataloguePresenter.class)
 public class CatalogueFragment extends BaseRxFragment<CataloguePresenter>
@@ -278,8 +279,10 @@ public class CatalogueFragment extends BaseRxFragment<CataloguePresenter>
         adapter.addItems(mangas);
     }
 
-    public void onAddPageError() {
+    public void onAddPageError(Throwable error) {
         hideProgressBar();
+        ToastUtil.showShort(getContext(), error.getMessage());
+        Timber.e(error, error.getMessage());
     }
 
     public void updateImage(Manga manga) {

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.java

@@ -70,7 +70,7 @@ public class CataloguePresenter extends BasePresenter<CatalogueFragment> {
         startableFirst(GET_MANGA_PAGE,
                 () -> pager.request(page -> getMangasPageObservable(page + 1)),
                 (view, next) -> {},
-                (view, error) -> view.onAddPageError());
+                (view, error) -> view.onAddPageError(error));
 
         startableLatestCache(GET_MANGA_DETAIL,
                 () -> mangaDetailSubject