Class ExceptionUtils

java.lang.Object
com.github.ushiosan23.jvm.system.error.ExceptionUtils

public final class ExceptionUtils extends Object
  • Method Details

    • getDeepCause

      @NotNull public static @NotNull Throwable getDeepCause(@NotNull @NotNull Throwable throwable)
      Returns the base cause of the exception. This method tries to find the main or root cause of the exception, it returns the same object if the exception is already the main cause.
      Parameters:
      throwable - The exception to be analyzed
      Returns:
      Returns the root cause of the exception
    • toString

      @NotNull public static @NotNull String toString(@NotNull @NotNull Throwable throwable, boolean verbose)
      Returns the exception stack trace in text format.
      Parameters:
      throwable - The exception to be analyzed
      verbose - Determines if the result is going to be verbose or simple
      Returns:
      Returns the exception stack trace string