ReactiveX / RxAndroid

RxJava bindings for Android
Apache License 2.0
19.89k stars 2.94k forks source link

I can not catch error from ResourceSubscriber<Response<T>. for example url error 404 #434

Closed Widiyanto closed 6 years ago

Widiyanto commented 6 years ago

@Override public void requestLogin(LoginRequest loginRequest, Context context) { mView.loadingShowLogin(); mDataManager.login(loginRequest) .compose(RxUtil.<Response<LoginResponse>>rxSchedulerHelper()) .subscribe(new ResourceSubscriber<Response<LoginResponse>>() {

                @Override
                public void onNext(Response<LoginResponse> loginResponse) {
                    if (loginResponse.code() == Constants.success) {
                        mView.showLogin(loginResponse);
                        mView.loadingHideLogin();
                    }
                }

                @Override
                public void onError(Throwable e) {
                    mView.loadingHideLogin();
                }

                @Override
                public void onComplete() {

                }
            });

}
JakeWharton commented 6 years ago

This is a general RxJava usage question which is far better suited to be asked on StackOverflow with the 'rx-java' tag or on the RxJava mailing list. Links to both are available in the README. There's nothing specific to RxAndroid here.