|
34 | 34 | import io.reactivex.Single; |
35 | 35 | import io.reactivex.SingleEmitter; |
36 | 36 | import io.reactivex.SingleOnSubscribe; |
| 37 | +import io.reactivex.SingleSource; |
37 | 38 | import io.reactivex.android.schedulers.AndroidSchedulers; |
| 39 | +import io.reactivex.functions.Function; |
38 | 40 | import io.reactivex.schedulers.Schedulers; |
39 | 41 | import okhttp3.Call; |
40 | 42 | import okhttp3.Callback; |
@@ -108,6 +110,11 @@ public void run() { |
108 | 110 | } |
109 | 111 | }).start(); |
110 | 112 | } |
| 113 | + }).onErrorResumeNext(new Function<Throwable, SingleSource<? extends T>>() { |
| 114 | + @Override |
| 115 | + public SingleSource<? extends T> apply(Throwable throwable) throws Exception { |
| 116 | + return Single.error(throwable); |
| 117 | + } |
111 | 118 | }); |
112 | 119 | } |
113 | 120 |
|
@@ -139,6 +146,11 @@ public void run() { |
139 | 146 | }).start(); |
140 | 147 |
|
141 | 148 | } |
| 149 | + }).onErrorResumeNext(new Function<Throwable, SingleSource<? extends T>>() { |
| 150 | + @Override |
| 151 | + public SingleSource<? extends T> apply(Throwable throwable) throws Exception { |
| 152 | + return Single.error(throwable); |
| 153 | + } |
142 | 154 | }); |
143 | 155 | } |
144 | 156 |
|
@@ -305,6 +317,11 @@ public void run() { |
305 | 317 | }).start(); |
306 | 318 |
|
307 | 319 | } |
| 320 | + }).onErrorResumeNext(new Function<Throwable, SingleSource<? extends String>>() { |
| 321 | + @Override |
| 322 | + public SingleSource<? extends String> apply(Throwable throwable) throws Exception { |
| 323 | + return Single.error(throwable); |
| 324 | + } |
308 | 325 | }); |
309 | 326 | } |
310 | 327 |
|
@@ -360,6 +377,11 @@ public void run() { |
360 | 377 | }).start(); |
361 | 378 |
|
362 | 379 | } |
| 380 | + }).onErrorResumeNext(new Function<Throwable, SingleSource<? extends String>>() { |
| 381 | + @Override |
| 382 | + public SingleSource<? extends String> apply(Throwable throwable) throws Exception { |
| 383 | + return Single.error(throwable); |
| 384 | + } |
363 | 385 | }); |
364 | 386 | } |
365 | 387 |
|
@@ -424,6 +446,11 @@ public void run() { |
424 | 446 | }).start(); |
425 | 447 |
|
426 | 448 | } |
| 449 | + }).onErrorResumeNext(new Function<Throwable, SingleSource<? extends T>>() { |
| 450 | + @Override |
| 451 | + public SingleSource<? extends T> apply(Throwable throwable) throws Exception { |
| 452 | + return Single.error(throwable); |
| 453 | + } |
427 | 454 | }); |
428 | 455 | } |
429 | 456 |
|
|
0 commit comments