public enum Exceptions extends java.lang.Enum<Exceptions>
Modifier and Type | Class and Description |
---|---|
static class |
Exceptions.AlertException
Used to alert consumers waiting with a
WaitStrategy for status changes. |
static class |
Exceptions.CancelException
An error signal from downstream subscribers consuming data when their state is denying any additional event.
|
static class |
Exceptions.DownstreamException
An exception that is propagated downward through
Subscriber.onError(Throwable) |
static class |
Exceptions.InsufficientCapacityException
Exception thrown when the it is not possible to dispatch a signal due to insufficient capacity.
|
static class |
Exceptions.ReactiveException
An exception helper for lambda and other checked-to-unchecked exception wrapping
|
static class |
Exceptions.UpstreamException
An exception that is propagated upward and considered as "fatal" as per Reactive Stream limited list of
exceptions allowed to bubble.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.Throwable |
TERMINATED
A singleton instance of a Throwable indicating a terminal state for exceptions, don't leak this!
|
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
addThrowable(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<T,java.lang.Throwable> field,
T instance,
java.lang.Throwable exception)
Signal a desynchronization of demand and timer.
|
static java.lang.NullPointerException |
argumentIsNullException() |
static java.lang.RuntimeException |
bubble(java.lang.Throwable t)
Return an unchecked
RuntimeException to be thrown that will bubble upstream. |
static java.lang.IllegalStateException |
duplicateOnSubscribeException() |
static Exceptions.CancelException |
failWithCancel()
Return a
Exceptions.CancelException |
static Exceptions.InsufficientCapacityException |
failWithOverflow()
Return an
Exceptions.InsufficientCapacityException |
static java.lang.IllegalArgumentException |
nullOrNegativeRequestException(long elements) |
static void |
onErrorDropped(java.lang.Throwable e)
Take an unsignalled exception that is masking anowher one due to callback failure.
|
static void |
onErrorDropped(java.lang.Throwable e,
java.lang.Throwable root)
Take an unsignalled exception that is masking anowher one due to callback failure.
|
static <T> void |
onNextDropped(T t)
An unexpected event is about to be dropped.
|
static java.lang.RuntimeException |
propagate(java.lang.Throwable t)
Return an unchecked
RuntimeException to be thrown that will be propagated
downstream through Subscriber.onError(Throwable) . |
static <T> java.lang.Throwable |
terminate(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<T,java.lang.Throwable> field,
T instance)
Atomic utility to safely mark a volatile throwable reference with a terminal marker.
|
static void |
throwIfFatal(java.lang.Throwable t)
Throws a particular
Throwable only if it belongs to a set of "fatal" error varieties. |
static java.lang.Throwable |
unwrap(java.lang.Throwable t)
Unwrap a particular
Throwable only if it is a wrapped UpstreamException or DownstreamException |
static Exceptions |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Exceptions[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final java.lang.Throwable TERMINATED
public static Exceptions[] values()
for (Exceptions c : Exceptions.values()) System.out.println(c);
public static Exceptions valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static <T> boolean addThrowable(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<T,java.lang.Throwable> field, T instance, java.lang.Throwable exception)
T
- the parent instance typefield
- the target field updaterinstance
- the parent instance for the fieldexception
- the Throwable to add.TERMINATED
instance.public static java.lang.NullPointerException argumentIsNullException()
NullPointerException
with a cause message abiding to reactive stream specification.public static java.lang.IllegalStateException duplicateOnSubscribeException()
IllegalStateException
with a cause message abiding to reactive stream specification.public static java.lang.RuntimeException propagate(java.lang.Throwable t)
RuntimeException
to be thrown that will be propagated
downstream through Subscriber.onError(Throwable)
.
This method invokes throwIfFatal(Throwable)
.
t
- the root causepublic static java.lang.RuntimeException bubble(java.lang.Throwable t)
RuntimeException
to be thrown that will bubble upstream.
This method invokes throwIfFatal(Throwable)
.
t
- the root causepublic static Exceptions.CancelException failWithCancel()
Exceptions.CancelException
Exceptions.CancelException
public static Exceptions.InsufficientCapacityException failWithOverflow()
Exceptions.InsufficientCapacityException
Exceptions.InsufficientCapacityException
public static java.lang.IllegalArgumentException nullOrNegativeRequestException(long elements)
elements
- the invalid requested demandIllegalArgumentException
with a cause message abiding to reactive stream specification.public static void onErrorDropped(java.lang.Throwable e, java.lang.Throwable root)
e
- the exception to handleroot
- the optional root cause to suppresspublic static void onErrorDropped(java.lang.Throwable e)
e
- the exception to handlepublic static <T> void onNextDropped(T t)
T
- the dropped value typet
- the dropping datapublic static <T> java.lang.Throwable terminate(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<T,java.lang.Throwable> field, T instance)
T
- the instance typefield
- the atomic containerinstance
- the reference instancepublic static void throwIfFatal(java.lang.Throwable t)
Throwable
only if it belongs to a set of "fatal" error varieties. These
varieties are as follows:
Exceptions.UpstreamException
StackOverflowError
VirtualMachineError
ThreadDeath
LinkageError
t
- the exception to evaluatepublic static java.lang.Throwable unwrap(java.lang.Throwable t)
Throwable
only if it is a wrapped UpstreamException or DownstreamExceptiont
- the exception to wrap