Class Throwables
- java.lang.Object
-
- org.apache.logging.log4j.core.util.Throwables
-
public final class Throwables extends Object
Helps with Throwable objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThrowablegetRootCause(Throwable throwable)Extracts the deepest exception in the causal chain of the giventhrowable.static voidrethrow(Throwable t)Rethrows aThrowable.static List<String>toStringList(Throwable throwable)Converts a Throwable stack trace into a List of Strings.
-
-
-
Method Detail
-
getRootCause
public static Throwable getRootCause(Throwable throwable)
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
public static List<String> toStringList(Throwable throwable)
Converts a Throwable stack trace into a List of Strings.- Parameters:
throwable- the Throwable- Returns:
- a List of Strings
-
-