Package ushiosan.jvm

Class UError

java.lang.Object
ushiosan.jvm.UError

public final class UError extends Object
  • Method Details

    • rootError

      @NotNull public static @NotNull Throwable rootError(@NotNull @NotNull Throwable exception, int deep)
      Gets 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:
      exception - base exception to analyze
      deep - the maximum size of steps before reaching the root of the error. If the value is 0, then it tries to return the original cause of the error (recursive).
      Returns:
      the root cause of error
    • rootError

      @NotNull public static @NotNull Throwable rootError(@NotNull @NotNull Throwable exception)
      Gets 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:
      exception - base exception to analyze
      Returns:
      the root cause of error
      See Also:
    • extractTrace

      @NotNull public static @NotNull String extractTrace(@NotNull @NotNull Throwable exception, int deep)
      Gets the content of an exception in text format.
      Parameters:
      exception - base exception to analyze
      deep - the maximum size of steps before reaching the root of the error. If the value is 0, then it tries to return the original cause of the error (recursive).
      Returns:
      The content of the exception in text format
    • extractTrace

      @NotNull public static @NotNull String extractTrace(@NotNull @NotNull Throwable exception)
      Gets the content of an exception in text format.
      Parameters:
      exception - base exception to analyze
      Returns:
      The content of the exception in text format