Package rx.exceptions
Class OnErrorThrowable
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
rx.exceptions.OnErrorThrowable
- All Implemented Interfaces:
Serializable
Represents a
Throwable that an Observable might 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 an OnErrorThrowable than is found in a typical Throwable, such
as the item the Observable was trying to emit at the time the error was encountered.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents 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
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate static final longprivate final Object -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateOnErrorThrowable(Throwable exception) privateOnErrorThrowable(Throwable exception, Object value) -
Method Summary
Modifier and TypeMethodDescriptionstatic ThrowableaddValueAsLastCause(Throwable e, Object value) Adds the given item as the final cause of the givenThrowable, wrapped inOnNextValue(which extendsRuntimeException).static OnErrorThrowableConverts aThrowableinto anOnErrorThrowable.getValue()Get the value associated with thisOnErrorThrowablebooleanIndicates whether or not there is a value associated with thisOnErrorThrowableMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
hasValue
private final boolean hasValue -
value
-
-
Constructor Details
-
OnErrorThrowable
-
OnErrorThrowable
-
-
Method Details
-
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
Converts aThrowableinto anOnErrorThrowable.- Parameters:
t- theThrowableto convert; if null, a NullPointerException is constructed- Returns:
- an
OnErrorThrowablerepresentation oft
-
addValueAsLastCause
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
-