call onErrorAction
This commit is contained in:
parent
44a6e79c09
commit
800a15fba6
|
|
@ -28,6 +28,7 @@ import rx.Observable;
|
|||
import rx.Single;
|
||||
import rx.Subscription;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.exceptions.OnErrorThrowable;
|
||||
import rx.functions.Action0;
|
||||
import rx.functions.Action1;
|
||||
import rx.functions.Actions;
|
||||
|
|
@ -250,7 +251,15 @@ public class BaseLifecycleBindable implements LifecycleBindable {
|
|||
actualObservable = observable.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnCompleted(onCompletedAction)
|
||||
.doOnNext(onNextAction)
|
||||
.onErrorResumeNext(Observable.empty());
|
||||
.onErrorResumeNext(throwable -> {
|
||||
final boolean isRxError = throwable instanceof OnErrorThrowable;
|
||||
if ((!isRxError && throwable instanceof RuntimeException)
|
||||
|| (isRxError && throwable.getCause() instanceof RuntimeException)) {
|
||||
Lc.assertion(throwable);
|
||||
}
|
||||
onErrorAction.call(throwable);
|
||||
return Observable.empty();
|
||||
});
|
||||
}
|
||||
|
||||
return isCreatedSubject.first()
|
||||
|
|
|
|||
Loading…
Reference in New Issue