Class Throwables

java.lang.Object
org.apache.logging.log4j.core.util.Throwables

public final class Throwables extends Object
Helps with Throwable objects.
  • Method Details

    • getRootCause

      public static Throwable getRootCause(Throwable throwable)
      Returns the deepest cause of the given throwable.
      Parameters:
      throwable - the throwable to navigate
      Returns:
      the deepest throwable or the given throwable
    • 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
    • rethrow

      public static void rethrow(Throwable t)
      Rethrows a Throwable.
      Parameters:
      t - the Throwable to throw.
      Since:
      2.1