Log message error when a request from the catalogue fails.

This commit is contained in:
inorichi 2016-02-25 16:33:30 +01:00
parent 61c7feca87
commit 50b97fa28f
2 changed files with 5 additions and 2 deletions

View file

@ -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) {

View file

@ -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