Package rx.exceptions
Class OnErrorThrowable
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- rx.exceptions.OnErrorThrowable
-
- All Implemented Interfaces:
java.io.Serializable
public final class OnErrorThrowable extends java.lang.RuntimeExceptionRepresents aThrowablethat anObservablemight notify its subscribers of, but that then can be handled by an operator that is designed to recover from or react appropriately to such an error. You can recover more information from anOnErrorThrowablethan is found in a typicalThrowable, such as the item theObservablewas trying to emit at the time the error was encountered.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOnErrorThrowable.OnNextValueRepresents an exception that was encountered while trying to emit an item from an Observable, and tries to preserve that item for future use and/or reporting.
-
Field Summary
Fields Modifier and Type Field Description private booleanhasValueprivate static longserialVersionUIDprivate java.lang.Objectvalue
-
Constructor Summary
Constructors Modifier Constructor Description privateOnErrorThrowable(java.lang.Throwable exception)privateOnErrorThrowable(java.lang.Throwable exception, java.lang.Object value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.ThrowableaddValueAsLastCause(java.lang.Throwable e, java.lang.Object value)Adds the given item as the final cause of the givenThrowable, wrapped inOnNextValue(which extendsRuntimeException).static OnErrorThrowablefrom(java.lang.Throwable t)Converts aThrowableinto anOnErrorThrowable.java.lang.ObjectgetValue()Get the value associated with thisOnErrorThrowablebooleanisValueNull()Indicates whether or not there is a value associated with thisOnErrorThrowable
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
hasValue
private final boolean hasValue
-
value
private final java.lang.Object value
-
-
Method Detail
-
getValue
public java.lang.Object getValue()
Get the value associated with thisOnErrorThrowable- Returns:
- the value associated with this
OnErrorThrowable(ornullif there is none)
-
isValueNull
public boolean isValueNull()
Indicates whether or not there is a value associated with thisOnErrorThrowable- Returns:
trueif there is a value associated with thisOnErrorThrowable, otherwisefalse
-
from
public static OnErrorThrowable from(java.lang.Throwable t)
Converts aThrowableinto anOnErrorThrowable.- Parameters:
t- theThrowableto convert; if null, a NullPointerException is constructed- Returns:
- an
OnErrorThrowablerepresentation oft
-
addValueAsLastCause
public static java.lang.Throwable addValueAsLastCause(java.lang.Throwable e, java.lang.Object value)Adds the given item as the final cause of the givenThrowable, wrapped inOnNextValue(which extendsRuntimeException).- Parameters:
e- theThrowableto which you want to add a causevalue- the item you want to add toeas the cause of theThrowable- Returns:
- the same
Throwable(e) that was passed in, withvalueadded to it as a cause
-
-