public final class Exceptions extends 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(Throwable e,
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 Throwable |
addValueAsLastCause(Throwable e,
Object value)
Adds the given item as the final cause of the given
Throwable , wrapped in OnNextValue
(which extends RuntimeException ). |
static Throwable |
getFinalCause(Throwable e)
Get the
Throwable at the end of the causality-chain for a particular Throwable |
static Object |
getFinalValueCause(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(Throwable t)
Throws a particular
Throwable only if it belongs to a set of "fatal" error varieties. |
public static void addCause(Throwable e, 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 Object getFinalValueCause(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 Throwable getFinalCause(Throwable e)
Throwable
at the end of the causality-chain for a particular Throwable
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 Throwable addValueAsLastCause(Throwable e, 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
causepublic static void throwIfFatal(Throwable t)
Throwable
only if it belongs to a set of "fatal" error varieties. These
varieties are as follows:
ReactorFatalException
StackOverflowError
VirtualMachineError
ThreadDeath
LinkageError
t
- Copyright © 2017. All rights reserved.