Skip to content

Commit 6417f0b

Browse files
Merge pull request #1306 from mattrjacobs/add-error-handler-to-error-swallowing-operators
Hooked RxJavaPlugins errorHandler up within all operators that swallow onErrors
2 parents c375f56 + 3cf18a1 commit 6417f0b

7 files changed

+14
-0
lines changed

rxjava-core/src/main/java/rx/internal/operators/OperatorMaterialize.java

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import rx.Notification;
1919
import rx.Observable.Operator;
2020
import rx.Subscriber;
21+
import rx.plugins.RxJavaPlugins;
2122

2223
/**
2324
* Turns all of the notifications from an Observable into <code>onNext</code> emissions, and marks
@@ -42,6 +43,7 @@ public void onCompleted() {
4243

4344
@Override
4445
public void onError(Throwable e) {
46+
RxJavaPlugins.getInstance().getErrorHandler().handleError(e);
4547
child.onNext(Notification.<T> createOnError(e));
4648
child.onCompleted();
4749
}

rxjava-core/src/main/java/rx/internal/operators/OperatorMergeDelayError.java

+2
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ public void onError(Throwable e) {
125125
public void onCompleted() {
126126
complete();
127127
}
128+
128129
void error(Throwable e) {
129130
exceptions.add(e);
130131
complete();
131132
}
133+
132134
void complete() {
133135
if (WIP_UPDATER.decrementAndGet(this) == 0) {
134136
if (exceptions.isEmpty()) {

rxjava-core/src/main/java/rx/internal/operators/OperatorOnErrorFlatMap.java

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import rx.Subscriber;
2121
import rx.exceptions.OnErrorThrowable;
2222
import rx.functions.Func1;
23+
import rx.plugins.RxJavaPlugins;
2324

2425
/**
2526
* Allows inserting onNext events into a stream when onError events are received
@@ -46,6 +47,7 @@ public void onCompleted() {
4647
@Override
4748
public void onError(Throwable e) {
4849
try {
50+
RxJavaPlugins.getInstance().getErrorHandler().handleError(e);
4951
Observable<? extends T> resume = resumeFunction.call(OnErrorThrowable.from(e));
5052
resume.unsafeSubscribe(new Subscriber<T>() {
5153

rxjava-core/src/main/java/rx/internal/operators/OperatorOnErrorResumeNextViaFunction.java

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import rx.Observable.Operator;
2020
import rx.Subscriber;
2121
import rx.functions.Func1;
22+
import rx.plugins.RxJavaPlugins;
2223

2324
/**
2425
* Instruct an Observable to pass control to another Observable (the return value of a function)
@@ -59,6 +60,7 @@ public void onCompleted() {
5960
@Override
6061
public void onError(Throwable e) {
6162
try {
63+
RxJavaPlugins.getInstance().getErrorHandler().handleError(e);
6264
Observable<? extends T> resume = resumeFunction.call(e);
6365
resume.unsafeSubscribe(child);
6466
} catch (Throwable e2) {

rxjava-core/src/main/java/rx/internal/operators/OperatorOnErrorResumeNextViaObservable.java

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import rx.Observable;
1919
import rx.Observable.Operator;
2020
import rx.Subscriber;
21+
import rx.plugins.RxJavaPlugins;
2122

2223
/**
2324
* Instruct an Observable to pass control to another Observable rather than invoking
@@ -58,6 +59,7 @@ public void onNext(T t) {
5859

5960
@Override
6061
public void onError(Throwable e) {
62+
RxJavaPlugins.getInstance().getErrorHandler().handleError(e);
6163
unsubscribe();
6264
resumeSequence.unsafeSubscribe(child);
6365
}

rxjava-core/src/main/java/rx/internal/operators/OperatorOnErrorReturn.java

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import rx.Subscriber;
2121
import rx.exceptions.CompositeException;
2222
import rx.functions.Func1;
23+
import rx.plugins.RxJavaPlugins;
2324

2425
/**
2526
* Instruct an Observable to emit a particular item to its Observer's <code>onNext</code> method
@@ -59,6 +60,7 @@ public void onNext(T t) {
5960
@Override
6061
public void onError(Throwable e) {
6162
try {
63+
RxJavaPlugins.getInstance().getErrorHandler().handleError(e);
6264
T result = resultFunction.call(e);
6365

6466
child.onNext(result);

rxjava-core/src/main/java/rx/internal/operators/OperatorOnExceptionResumeNextViaObservable.java

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import rx.Observable;
1919
import rx.Observable.Operator;
2020
import rx.Subscriber;
21+
import rx.plugins.RxJavaPlugins;
2122

2223
/**
2324
* Instruct an Observable to pass control to another Observable rather than invoking
@@ -63,6 +64,7 @@ public void onNext(T t) {
6364
@Override
6465
public void onError(Throwable e) {
6566
if (e instanceof Exception) {
67+
RxJavaPlugins.getInstance().getErrorHandler().handleError(e);
6668
unsubscribe();
6769
resumeSequence.unsafeSubscribe(child);
6870
} else {

0 commit comments

Comments
 (0)