File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,6 @@ public static class OnNextValue extends RuntimeException {
110
110
111
111
private static final long serialVersionUID = -3454462756050397899L ;
112
112
113
- private static final RxJavaErrorHandler ERROR_HANDLER = RxJavaPlugins .getInstance ().getErrorHandler ();
114
-
115
113
private final Object value ;
116
114
117
115
/**
@@ -164,7 +162,7 @@ private static String renderValue(Object value){
164
162
return ((Enum <?>) value ).name ();
165
163
}
166
164
167
- String pluggedRendering = ERROR_HANDLER .handleOnNextValueRendering (value );
165
+ String pluggedRendering = RxJavaPlugins . getInstance (). getErrorHandler () .handleOnNextValueRendering (value );
168
166
if (pluggedRendering != null ) {
169
167
return pluggedRendering ;
170
168
}
Original file line number Diff line number Diff line change 18
18
import rx .Observable ;
19
19
import rx .Subscriber ;
20
20
import rx .annotations .Experimental ;
21
+ import rx .exceptions .Exceptions ;
21
22
import rx .exceptions .OnErrorThrowable ;
22
23
23
24
/**
@@ -65,11 +66,15 @@ public void handleError(Throwable e) {
65
66
*/
66
67
@ Experimental
67
68
public final String handleOnNextValueRendering (Object item ) {
69
+
68
70
try {
69
71
return render (item );
72
+ } catch (InterruptedException e ) {
73
+ Thread .currentThread ().interrupt ();
70
74
} catch (Throwable t ) {
71
- return item . getClass (). getName () + ERROR_IN_RENDERING_SUFFIX ;
75
+ Exceptions . throwIfFatal ( t ) ;
72
76
}
77
+ return item .getClass ().getName () + ERROR_IN_RENDERING_SUFFIX ;
73
78
}
74
79
75
80
/**
@@ -84,9 +89,10 @@ public final String handleOnNextValueRendering(Object item) {
84
89
*
85
90
* @param item the last emitted item, that caused the exception wrapped in {@link OnErrorThrowable.OnNextValue}.
86
91
* @return a short {@link String} representation of the item if one is known for its type, or null for default.
92
+ * @throws InterruptedException if the rendering thread is interrupted
87
93
*/
88
94
@ Experimental
89
- protected String render (Object item ) {
95
+ protected String render (Object item ) throws InterruptedException {
90
96
//do nothing by default
91
97
return null ;
92
98
}
You can’t perform that action at this time.
0 commit comments