File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1663,8 +1663,9 @@ public void onError(Throwable e) {
1663
1663
try {
1664
1664
b = predicate .call (e );
1665
1665
} catch (Throwable ex ) {
1666
+ Exceptions .throwIfFatal (ex );
1666
1667
e = new CompositeException (Arrays .asList (e , ex ));
1667
- return ;
1668
+ b = false ;
1668
1669
}
1669
1670
1670
1671
if (b ) {
Original file line number Diff line number Diff line change @@ -4112,4 +4112,29 @@ public void onStart() {
4112
4112
ts .assertCompleted ();
4113
4113
}
4114
4114
4115
+ @ Test
4116
+ public void onErrorCompleteFunctionThrows () {
4117
+ TestSubscriber <String > ts = new TestSubscriber <String >();
4118
+
4119
+ error .completable .onErrorComplete (new Func1 <Throwable , Boolean >() {
4120
+ @ Override
4121
+ public Boolean call (Throwable t ) {
4122
+ throw new TestException ("Forced inner failure" );
4123
+ }
4124
+ }).subscribe (ts );
4125
+
4126
+ ts .assertNoValues ();
4127
+ ts .assertNotCompleted ();
4128
+ ts .assertError (CompositeException .class );
4129
+
4130
+ CompositeException composite = (CompositeException )ts .getOnErrorEvents ().get (0 );
4131
+
4132
+ List <Throwable > errors = composite .getExceptions ();
4133
+ Assert .assertEquals (2 , errors .size ());
4134
+
4135
+ Assert .assertTrue (errors .get (0 ).toString (), errors .get (0 ) instanceof TestException );
4136
+ Assert .assertEquals (errors .get (0 ).toString (), null , errors .get (0 ).getMessage ());
4137
+ Assert .assertTrue (errors .get (1 ).toString (), errors .get (1 ) instanceof TestException );
4138
+ Assert .assertEquals (errors .get (1 ).toString (), "Forced inner failure" , errors .get (1 ).getMessage ());
4139
+ }
4115
4140
}
You can’t perform that action at this time.
0 commit comments