public final class Exceptions
extends java.lang.Object
Exception related functions.| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getStackTrace(java.lang.Throwable exception)
Get an
Exception's stack trace. |
static void |
ignore(java.lang.Throwable exception)
Ignore an
Exception. |
static java.lang.RuntimeException |
toRuntime(java.lang.Throwable exception)
Make an
Exception unchecked by wrapping it into a RuntimeException. |
static void |
warn(java.lang.Throwable exception)
Warn about an
Exception and discard it. |
public static java.lang.RuntimeException toRuntime(java.lang.Throwable exception)
Exception unchecked by wrapping it into a RuntimeException.exception - The exception to make unchecked.public static void ignore(@Nullable java.lang.Throwable exception)
Exception.
This function simply logs the exception using the trace log level.
exception - The exception to ignore (may be null).public static void warn(@Nullable java.lang.Throwable exception)
Exception and discard it.
This function simply logs the exception using the warning log level.
exception - The exception to warn about (may be null).public static java.lang.String getStackTrace(java.lang.Throwable exception)
Exception's stack trace.exception - The exception to get the stack trace for.