16
16
package rx .exceptions ;
17
17
18
18
/**
19
- * @warn javadoc class description missing
19
+ * Represents a {@code Throwable} that an {@code Observable} might notify its subscribers of, but that then can
20
+ * be handled by an operator that is designed to recover from or react appropriately to such an error. You can
21
+ * recover more information from an {@code OnErrorThrowable} than is found in a typical {@code Throwable}, such
22
+ * as the item the {@code Observable} was trying to emit at the time the error was encountered.
20
23
*/
21
24
public class OnErrorThrowable extends RuntimeException {
22
25
@@ -38,8 +41,9 @@ private OnErrorThrowable(Throwable exception, Object value) {
38
41
}
39
42
40
43
/**
41
- * @warn javadoc missing
42
- * @return
44
+ * Get the value associated with this {@code OnErrorThrowable}
45
+ *
46
+ * @return the value associated with this {@code OnErrorThrowable} (or {@code null} if there is none)
43
47
*/
44
48
public Object getValue () {
45
49
return value ;
@@ -72,13 +76,13 @@ public static OnErrorThrowable from(Throwable t) {
72
76
}
73
77
74
78
/**
75
- * Adds the given value as the final cause of the given {@code Throwable} wrapped in
76
- * {@code OnNextValue}/ {@code RuntimeException}.
79
+ * Adds the given item as the final cause of the given {@code Throwable}, wrapped in {@code OnNextValue}
80
+ * (which extends {@code RuntimeException}) .
77
81
*
78
82
* @param e
79
83
* the {@link Throwable} to which you want to add a cause
80
84
* @param value
81
- * the cause you want to add to {@code e}
85
+ * the item you want to add to {@code e} as the cause of the {@code Throwable }
82
86
* @return the same {@code Throwable} ({@code e}) that was passed in, with {@code value} added to it as a
83
87
* cause
84
88
*/
@@ -96,24 +100,30 @@ public static Throwable addValueAsLastCause(Throwable e, Object value) {
96
100
}
97
101
98
102
/**
99
- * @warn javadoc class description missing
103
+ * Represents an exception that was encountered while trying to emit an item from an Observable, and
104
+ * tries to preserve that item for future use and/or reporting.
100
105
*/
101
106
public static class OnNextValue extends RuntimeException {
102
107
103
108
private static final long serialVersionUID = -3454462756050397899L ;
104
109
private final Object value ;
105
110
106
111
/**
107
- * @warn javadoc missing
112
+ * Create an {@code OnNextValue} exception and include in its error message a string representation of
113
+ * the item that was intended to be emitted at the time the exception was handled.
114
+ *
115
+ * @param value
116
+ * the item that the Observable was trying to emit at the time of the exception
108
117
*/
109
118
public OnNextValue (Object value ) {
110
119
super ("OnError while emitting onNext value: " + value );
111
120
this .value = value ;
112
121
}
113
122
114
123
/**
115
- * @warn javadoc missing
116
- * @return
124
+ * Retrieve the item that the Observable was trying to emit at the time this exception occurred.
125
+ *
126
+ * @return the item that the Observable was trying to emit at the time of the exception
117
127
*/
118
128
public Object getValue () {
119
129
return value ;
0 commit comments