Log message error when a request from the catalogue fails.
This commit is contained in:
parent
61c7feca87
commit
50b97fa28f
2 changed files with 5 additions and 2 deletions
|
@ -49,6 +49,7 @@ import nucleus.factory.RequiresPresenter;
|
||||||
import rx.Subscription;
|
import rx.Subscription;
|
||||||
import rx.android.schedulers.AndroidSchedulers;
|
import rx.android.schedulers.AndroidSchedulers;
|
||||||
import rx.subjects.PublishSubject;
|
import rx.subjects.PublishSubject;
|
||||||
|
import timber.log.Timber;
|
||||||
|
|
||||||
@RequiresPresenter(CataloguePresenter.class)
|
@RequiresPresenter(CataloguePresenter.class)
|
||||||
public class CatalogueFragment extends BaseRxFragment<CataloguePresenter>
|
public class CatalogueFragment extends BaseRxFragment<CataloguePresenter>
|
||||||
|
@ -278,8 +279,10 @@ public class CatalogueFragment extends BaseRxFragment<CataloguePresenter>
|
||||||
adapter.addItems(mangas);
|
adapter.addItems(mangas);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAddPageError() {
|
public void onAddPageError(Throwable error) {
|
||||||
hideProgressBar();
|
hideProgressBar();
|
||||||
|
ToastUtil.showShort(getContext(), error.getMessage());
|
||||||
|
Timber.e(error, error.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateImage(Manga manga) {
|
public void updateImage(Manga manga) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class CataloguePresenter extends BasePresenter<CatalogueFragment> {
|
||||||
startableFirst(GET_MANGA_PAGE,
|
startableFirst(GET_MANGA_PAGE,
|
||||||
() -> pager.request(page -> getMangasPageObservable(page + 1)),
|
() -> pager.request(page -> getMangasPageObservable(page + 1)),
|
||||||
(view, next) -> {},
|
(view, next) -> {},
|
||||||
(view, error) -> view.onAddPageError());
|
(view, error) -> view.onAddPageError(error));
|
||||||
|
|
||||||
startableLatestCache(GET_MANGA_DETAIL,
|
startableLatestCache(GET_MANGA_DETAIL,
|
||||||
() -> mangaDetailSubject
|
() -> mangaDetailSubject
|
||||||
|
|
Reference in a new issue