public final class OnErrorThrowable
extends java.lang.RuntimeException
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.Modifier and Type | Class and Description |
---|---|
static class |
OnErrorThrowable.OnNextValue
Represents 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.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.Throwable |
addValueAsLastCause(java.lang.Throwable e,
java.lang.Object value)
Adds the given item as the final cause of the given
Throwable , wrapped in OnNextValue
(which extends RuntimeException ). |
static OnErrorThrowable |
from(java.lang.Throwable t)
Converts a
Throwable into an OnErrorThrowable . |
java.lang.Object |
getValue()
Get the value associated with this
OnErrorThrowable |
boolean |
isValueNull()
Indicates whether or not there is a value associated with this
OnErrorThrowable |
public java.lang.Object getValue()
OnErrorThrowable
OnErrorThrowable
(or null
if there is none)public boolean isValueNull()
OnErrorThrowable
true
if there is a value associated with this OnErrorThrowable
, otherwise
false
public static OnErrorThrowable from(java.lang.Throwable t)
Throwable
into an OnErrorThrowable
.t
- the Throwable
to convert; if null, a NullPointerException is constructedOnErrorThrowable
representation of t
public static java.lang.Throwable addValueAsLastCause(java.lang.Throwable e, java.lang.Object value)
Throwable
, wrapped in OnNextValue
(which extends RuntimeException
).e
- the Throwable
to which you want to add a causevalue
- the item you want to add to e
as the cause of the Throwable
Throwable
(e
) that was passed in, with value
added to it as a
cause