Package io.deephaven.util
Class MultiException
java.lang.Object
java.lang.Throwable
java.lang.Exception
io.deephaven.util.MultiException
- All Implemented Interfaces:
Serializable
An exception to use when a series of operations must all be executed, but may all throw exceptions themselves. This
allows for retention of all exception data.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMultiException
(String description, Throwable... causes) Create a MultiException from an array of Throwable causes. -
Method Summary
Modifier and TypeMethodDescriptionstatic Exception
maybeWrapInMultiException
(String description, Exception... causes) If there is a single exception, return that exception; otherwise wrap the causes into a MultiException.static Throwable
maybeWrapInMultiException
(String description, Throwable... causes) If there is a single exception, return that exception; otherwise wrap the causes into a MultiException.static Throwable
maybeWrapInMultiException
(String description, List<? extends Throwable> causes) If there is a single exception, return that exception; otherwise wrap the causes into a MultiException.void
void
toString()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace
-
Field Details
-
ZERO_LENGTH_THROWABLE_ARRAY
-
-
Constructor Details
-
MultiException
Create a MultiException from an array of Throwable causes.- Parameters:
description
- the message to usecauses
- a list of causes
-
-
Method Details
-
maybeWrapInMultiException
If there is a single exception, return that exception; otherwise wrap the causes into a MultiException.- Parameters:
description
- the description for the MultiExceptioncauses
- the array of causes- Returns:
- a MultiException or the single Throwable
-
maybeWrapInMultiException
public static Throwable maybeWrapInMultiException(String description, List<? extends Throwable> causes) If there is a single exception, return that exception; otherwise wrap the causes into a MultiException.- Parameters:
description
- the description for the MultiExceptioncauses
- the list of causes- Returns:
- a MultiException or the single Throwable
-
maybeWrapInMultiException
If there is a single exception, return that exception; otherwise wrap the causes into a MultiException.- Parameters:
description
- the description for the MultiExceptioncauses
- the array of causes- Returns:
- a MultiException or the single Exception
-
getCauses
- Returns:
- all of the exceptions that resulted in this one.
-
printStackTrace
- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
- Overrides:
printStackTrace
in classThrowable
-
getMessage
- Overrides:
getMessage
in classThrowable
-
toString
-