Skip to content

Commit 832ca86

Browse files
committed
Merge pull request #8 from stealthcode/1.x
Fixing issue with the DebugSubscriber and DebugSubscription swallowing exceptions
2 parents 30a0218 + a6df92f commit 832ca86

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/main/java/rx/operators/DebugSubscriber.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
package rx.operators;
1414

1515
import rx.Observable.Operator;
16-
import rx.Observer;
1716
import rx.Producer;
1817
import rx.Subscriber;
18+
import rx.exceptions.Exceptions;
1919
import rx.plugins.DebugNotification;
2020
import rx.plugins.DebugNotificationListener;
2121

@@ -43,6 +43,7 @@ public void onStart() {
4343
listener.complete(context);
4444
} catch (Throwable e) {
4545
listener.error(context, e);
46+
throw Exceptions.propagate(e);
4647
}
4748
}
4849

@@ -55,6 +56,7 @@ public void onCompleted() {
5556
listener.complete(context);
5657
} catch (Throwable e) {
5758
listener.error(context, e);
59+
throw Exceptions.propagate(e);
5860
}
5961
}
6062

@@ -67,6 +69,7 @@ public void onError(Throwable e) {
6769
listener.complete(context);
6870
} catch (Throwable e2) {
6971
listener.error(context, e2);
72+
throw Exceptions.propagate(e);
7073
}
7174
}
7275

@@ -81,6 +84,7 @@ public void onNext(T t) {
8184
listener.complete(context);
8285
} catch (Throwable e) {
8386
listener.error(context, e);
87+
throw Exceptions.propagate(e);
8488
}
8589
}
8690

@@ -97,6 +101,7 @@ public void request(long n) {
97101
listener.complete(context);
98102
} catch (Throwable e) {
99103
listener.error(context, e);
104+
throw Exceptions.propagate(e);
100105
}
101106
}
102107
});

src/main/java/rx/operators/DebugSubscription.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
package rx.operators;
1414

1515
import rx.Subscription;
16+
import rx.exceptions.Exceptions;
1617
import rx.plugins.DebugNotification;
1718
import rx.plugins.DebugNotificationListener;
1819

@@ -34,6 +35,7 @@ public void unsubscribe() {
3435
listener.complete(context);
3536
} catch (Throwable e) {
3637
listener.error(context, e);
38+
throw Exceptions.propagate(e);
3739
}
3840
}
3941

src/main/java/rx/plugins/DebugHook.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import rx.Observable.Operator;
1818
import rx.Subscriber;
1919
import rx.Subscription;
20+
import rx.exceptions.Exceptions;
2021
import rx.operators.DebugSubscriber;
2122

2223
/**
@@ -56,6 +57,7 @@ public void call(Subscriber<? super T> o) {
5657
listener.complete(context);
5758
} catch (Throwable e) {
5859
listener.error(context, e);
60+
throw Exceptions.propagate(e);
5961
}
6062
}
6163
};

src/test/java/rx/debug/DebugHookTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.junit.Test;
2424

2525
import rx.Observable;
26-
import rx.Subscriber;
2726
import rx.functions.Func1;
2827
import rx.observers.Subscribers;
2928
import rx.plugins.DebugHook;
@@ -36,8 +35,6 @@
3635

3736
import java.util.Arrays;
3837
import java.util.Iterator;
39-
import java.util.Map.Entry;
40-
import java.util.Queue;
4138
import java.util.SortedSet;
4239

4340
public class DebugHookTest {

0 commit comments

Comments
 (0)