public final class Throwables
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
throwAsUnchecked(java.lang.Throwable t)
Throws the given exception as unchecked by either casting it
to RuntimeException or wrapping it into a RuntimeException, if not null.
|
static void |
throwAsUncheckedWithCause(java.lang.Throwable t,
java.lang.Throwable cause)
Sets up the cause for the exception and throws it by either
casting it to RuntimeException or wrapping it into a RuntimeException.
|
public static void throwAsUnchecked(@Nullable
java.lang.Throwable t)
t - the exception to throw as unchecked if not nullpublic static void throwAsUncheckedWithCause(@Nullable
java.lang.Throwable t,
@Nonnull
java.lang.Throwable cause)
t - the exception to throw, null means no-opcause - the cause for the exception