Exception (or rather Throwable utility methods.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | addSuppressedIfNotAssociated(Throwable
The main Throwable throwable, Throwable The Throwable to suppress if it is not associated. suppressed)Add a suppressed exception if it is not associated. |
| public static boolean | Returns: true iff the exceptions are not associated by being the same instance, sharing a cause or one suppressing the other.A Throwable or null t1, Throwable Another Throwable or null t2)Check if two |
| public static < The type of the T extends Throwable> TThrowable to be returned | |
| public static Throwable | |
| public static < The type of the T> TCompletableFuture | Returns: The value from callingCompletableFuture#get()The future to get from. completableFuture)Get from a |
| public static void | ifExceptionThrow(Throwable
The throwable)Throwable to throw or null.Throw a |
| public static < The type of the T extends Throwable> voidThrowable to be thrown if throwable is not null. | |
| public static < The type of the T extends Throwable> voidThrowable to be thrown if throwable is not null. | |
| public static void | ifExceptionThrowUnchecked(Throwable
The throwable)Throwable to throw or null. |
| public static < of type Throwable T extends Throwable> T | Returns: the original throwable with suppressed errorsthe throwable t, List<Throwable> the list of errors errors)Decorate a Throwable with the suppressed errors and return it. |
| ExceptionUtil | back to summary |
|---|---|
| private ExceptionUtil() | |
| addSuppressedIfNotAssociated | back to summary |
|---|---|
| public static void addSuppressedIfNotAssociated(Throwable throwable, Throwable suppressed) Add a suppressed exception if it is not associated.
| |
| areNotAssociated | back to summary |
|---|---|
| public static boolean areNotAssociated(Throwable t1, Throwable t2) Check if two | |
| as | back to summary |
|---|---|
| public static <T extends Throwable> T as(Class<T> type, Throwable throwable) throws IllegalArgumentException Convert a
| |
| combine | back to summary |
|---|---|
| public static Throwable combine(Throwable t1, Throwable t2) Combine two, possible null,
Throwable multiException = null;
for (Runnable task : manyThings)
{
try
{
task.run();
}
catch(Throwable t)
{
multiException = multiException.combine(multiException, t)
}
}
MultiException.ifExceptionalThrow(multiException);
| |
| get | back to summary |
|---|---|
| public static <T> T get(CompletableFuture<T> completableFuture) Get from a
| |
| ifExceptionThrow | back to summary |
|---|---|
| public static void ifExceptionThrow(Throwable throwable) throws Error, Exception Throw a | |
| ifExceptionThrowAllAs | back to summary |
|---|---|
| public static <T extends Throwable> void ifExceptionThrowAllAs(Class<T> type, Throwable throwable) throws Throwable-:T Throw a
| |
| ifExceptionThrowAs | back to summary |
|---|---|
| public static <T extends Throwable> void ifExceptionThrowAs(Class<T> type, Throwable throwable) throws Error, RuntimeException, Throwable-:T, IllegalArgumentException Throw a
| |
| ifExceptionThrowUnchecked | back to summary |
|---|---|
| public static void ifExceptionThrowUnchecked(Throwable throwable) throws Error, RuntimeException | |
| withSuppressed | back to summary |
|---|---|
| public static <T extends Throwable> T withSuppressed(T t, List<Throwable> errors) Decorate a Throwable with the suppressed errors and return it. | |
| Modifier and Type | Field and Description |
|---|---|
| private Throwable |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public <T extends Throwable> void | |
| public void |
| _multiException | back to summary |
|---|---|
| private Throwable _multiException | |
| MultiException | back to summary |
|---|---|
| public MultiException() | |
| add | back to summary |
|---|---|
| public void add(Throwable t) | |
| callAndCatch | back to summary |
|---|---|
| public void callAndCatch(Invocable. | |
| ifExceptionThrow | back to summary |
|---|---|
| public void ifExceptionThrow() throws Exception | |
| ifExceptionThrowAs | back to summary |
|---|---|
| public <T extends Throwable> void ifExceptionThrowAs(Class<T> type) throws Class-:T | |
| ifExceptionThrowRuntime | back to summary |
|---|---|
| public void ifExceptionThrowRuntime() | |