public final class OnErrorThrowable extends 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
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 Throwable |
addValueAsLastCause(Throwable
Adds the given item as the final cause of the given
Throwable, wrapped in
OnNextValue (which extends
RuntimeException).
|
static OnErrorThrowable |
from(Throwable
Converts a
Throwable into an
OnErrorThrowable.
|
Object |
getValue()
Get the value associated with this
OnErrorThrowable
|
boolean |
isValueNull()
Indicates whether or not there is a value associated with this
OnErrorThrowable
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic ObjectgetValue()
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 OnErrorThrowablefrom(Throwable t)
Throwable into an
OnErrorThrowable.
t - the
Throwable to convert
OnErrorThrowable representation of
t
public static ThrowableaddValueAsLastCause(Throwable e, Object value)
Throwable, wrapped in
OnNextValue (which extends
RuntimeException).
e - the
Throwable to which you want to add a cause
value - 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