|
25 | 25 | import java.util.concurrent.TimeUnit;
|
26 | 26 |
|
27 | 27 | import rx.exceptions.Exceptions;
|
| 28 | +import rx.exceptions.OnErrorThrowable; |
28 | 29 | import rx.exceptions.OnErrorNotImplementedException;
|
29 | 30 | import rx.functions.Action0;
|
30 | 31 | import rx.functions.Action1;
|
|
79 | 80 | import rx.operators.OperationMergeMaxConcurrent;
|
80 | 81 | import rx.operators.OperationMinMax;
|
81 | 82 | import rx.operators.OperationMulticast;
|
82 |
| -import rx.operators.OperationOnErrorResumeNextViaFunction; |
83 | 83 | import rx.operators.OperationOnErrorResumeNextViaObservable;
|
84 | 84 | import rx.operators.OperationOnErrorReturn;
|
85 | 85 | import rx.operators.OperationOnExceptionResumeNextViaObservable;
|
86 | 86 | import rx.operators.OperationParallelMerge;
|
87 | 87 | import rx.operators.OperationReplay;
|
88 | 88 | import rx.operators.OperationRetry;
|
89 | 89 | import rx.operators.OperationSample;
|
90 |
| -import rx.operators.OperatorObserveOnBounded; |
91 |
| -import rx.operators.OperatorScan; |
92 | 90 | import rx.operators.OperationSequenceEqual;
|
93 | 91 | import rx.operators.OperationSingle;
|
94 | 92 | import rx.operators.OperationSkip;
|
|
117 | 115 | import rx.operators.OperatorMap;
|
118 | 116 | import rx.operators.OperatorMerge;
|
119 | 117 | import rx.operators.OperatorObserveOn;
|
| 118 | +import rx.operators.OperatorOnErrorResumeNextViaFunction; |
| 119 | +import rx.operators.OperatorOnErrorFlatMap; |
120 | 120 | import rx.operators.OperatorParallel;
|
121 | 121 | import rx.operators.OperatorRepeat;
|
| 122 | +import rx.operators.OperatorScan; |
122 | 123 | import rx.operators.OperatorSubscribeOn;
|
123 | 124 | import rx.operators.OperatorTake;
|
124 | 125 | import rx.operators.OperatorTimeout;
|
@@ -5209,7 +5210,7 @@ public final Boolean call(T t) {
|
5209 | 5210 | * @see <a href="https://github.com/Netflix/RxJava/wiki/Error-Handling-Operators#wiki-onerrorresumenext">RxJava Wiki: onErrorResumeNext()</a>
|
5210 | 5211 | */
|
5211 | 5212 | public final Observable<T> onErrorResumeNext(final Func1<Throwable, ? extends Observable<? extends T>> resumeFunction) {
|
5212 |
| - return create(OperationOnErrorResumeNextViaFunction.onErrorResumeNextViaFunction(this, resumeFunction)); |
| 5213 | + return lift(new OperatorOnErrorResumeNextViaFunction<T>(resumeFunction)); |
5213 | 5214 | }
|
5214 | 5215 |
|
5215 | 5216 | /**
|
@@ -5267,6 +5268,15 @@ public final Observable<T> onErrorReturn(Func1<Throwable, ? extends T> resumeFun
|
5267 | 5268 | return create(OperationOnErrorReturn.onErrorReturn(this, resumeFunction));
|
5268 | 5269 | }
|
5269 | 5270 |
|
| 5271 | + /** |
| 5272 | + * Allows inserting onNext events into a stream when onError events are received |
| 5273 | + * and continuing the original sequence instead of terminating. Thus it allows a sequence |
| 5274 | + * with multiple onError events. |
| 5275 | + */ |
| 5276 | + public final Observable<T> onErrorFlatMap(final Func1<OnErrorThrowable, ? extends Observable<? extends T>> resumeFunction) { |
| 5277 | + return lift(new OperatorOnErrorFlatMap<T>(resumeFunction)); |
| 5278 | + } |
| 5279 | + |
5270 | 5280 | /**
|
5271 | 5281 | * Instruct an Observable to pass control to another Observable rather than invoking
|
5272 | 5282 | * {@link Observer#onError onError} if it encounters an {@link java.lang.Exception}.
|
|
0 commit comments