File tree 2 files changed +25
-0
lines changed 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ public static RuntimeException propagate(Throwable t) {
61
61
* <ul>
62
62
* <li>{@link OnErrorNotImplementedException}</li>
63
63
* <li>{@link OnErrorFailedException}</li>
64
+ * <li>{@link OnCompletedFailedException}</li>
64
65
* <li>{@code StackOverflowError}</li>
65
66
* <li>{@code VirtualMachineError}</li>
66
67
* <li>{@code ThreadDeath}</li>
@@ -80,6 +81,8 @@ public static void throwIfFatal(Throwable t) {
80
81
throw (OnErrorNotImplementedException ) t ;
81
82
} else if (t instanceof OnErrorFailedException ) {
82
83
throw (OnErrorFailedException ) t ;
84
+ } else if (t instanceof OnCompletedFailedException ) {
85
+ throw (OnCompletedFailedException ) t ;
83
86
}
84
87
// values here derived from https://github.com/ReactiveX/RxJava/issues/748#issuecomment-32471495
85
88
else if (t instanceof StackOverflowError ) {
Original file line number Diff line number Diff line change @@ -46,6 +46,28 @@ public void call(Integer t1) {
46
46
});
47
47
}
48
48
49
+ /**
50
+ * https://github.com/ReactiveX/RxJava/issues/3885
51
+ */
52
+ @ Test (expected = OnCompletedFailedException .class )
53
+ public void testOnCompletedExceptionIsThrown () {
54
+ Observable .empty ()
55
+ .subscribe (new Subscriber <Object >() {
56
+ @ Override
57
+ public void onCompleted () {
58
+ throw new RuntimeException ();
59
+ }
60
+
61
+ @ Override
62
+ public void onError (Throwable e ) {
63
+ }
64
+
65
+ @ Override
66
+ public void onNext (Object o ) {
67
+ }
68
+ });
69
+ }
70
+
49
71
@ Test
50
72
public void testStackOverflowWouldOccur () {
51
73
final PublishSubject <Integer > a = PublishSubject .create ();
You can’t perform that action at this time.
0 commit comments