Class Throwables
java.lang.Object
org.apache.logging.log4j.core.util.Throwables
Helps with Throwable objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ThrowablegetRootCause(Throwable throwable) Extracts the deepest exception in the causal chain of the giventhrowable.static voidRethrows aThrowable.toStringList(Throwable throwable) Converts a Throwable stack trace into a List of Strings.
-
Method Details
-
getRootCause
Extracts the deepest exception in the causal chain of the giventhrowable. Circular references will be handled and ignored.- Parameters:
throwable- a throwable to navigate- Returns:
- the deepest exception in the causal chain
-
toStringList
Converts a Throwable stack trace into a List of Strings.- Parameters:
throwable- the Throwable- Returns:
- a List of Strings
-
rethrow
Rethrows aThrowable.- Parameters:
t- the Throwable to throw.- Since:
- 2.1
-