public final class Exceptions
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Exceptions.ValueCause
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.
|
| Constructor and Description |
|---|
Exceptions() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addCause(java.lang.Throwable e,
java.lang.Throwable cause)
Adds a
Throwable to a causality-chain of Throwables, as an additional cause (if it does not
already appear in the chain among the causes). |
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 java.lang.Throwable |
getFinalCause(java.lang.Throwable e)
Get the
Throwable at the end of the causality-chain for a particular Throwable |
static java.lang.Object |
getFinalValueCause(java.lang.Throwable e)
Try to find the last value at the end of the causality-chain for a particular
Throwable
If the final cause wasn't of type Exceptions.ValueCause,
return null; |
static void |
throwIfFatal(java.lang.Throwable t)
Throws a particular
Throwable only if it belongs to a set of "fatal" error varieties. |
public static void addCause(java.lang.Throwable e,
java.lang.Throwable cause)
Throwable to a causality-chain of Throwables, as an additional cause (if it does not
already appear in the chain among the causes).e - the Throwable at the head of the causality chaincause - the Throwable you want to add as a cause of the chainpublic static java.lang.Object getFinalValueCause(java.lang.Throwable e)
Throwable
If the final cause wasn't of type Exceptions.ValueCause,
return null;e - the Throwable whose final cause you are curious aboutThrowable in the causality-chain of e (or a "Stack too deep to get
final cause" RuntimeException if the chain is too long to traverse)public static java.lang.Throwable getFinalCause(java.lang.Throwable e)
Throwable at the end of the causality-chain for a particular Throwablee - the Throwable whose final cause you are curious aboutThrowable in the causality-chain of e (or a "Stack too deep to get
final cause" RuntimeException if the chain is too long to traverse)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 ThrowableThrowable (e) that was passed in, with value added to it as a
causepublic static void throwIfFatal(java.lang.Throwable t)
Throwable only if it belongs to a set of "fatal" error varieties. These
varieties are as follows:
ReactorFatalExceptionStackOverflowErrorVirtualMachineErrorThreadDeathLinkageErrort -