Class ExceptionUtils

java.lang.Object
scriptella.util.ExceptionUtils

public final class ExceptionUtils extends Object
Utility class to work with throwables.
Version:
1.0
Author:
Fyodor Kupolov
  • Method Details

    • getCause

      public static Throwable getCause(Throwable throwable)
      This method checks if throwable has cause. If cause==null, this method tries to obtain cause based on throwable type, e.g. SQLException.getNextException()
      Parameters:
      throwable - throwable to find cause.
      Returns:
      cause of throwable.
    • throwUnchecked

      public static void throwUnchecked(Throwable unchecked)
      This method throws unchecked throwable, i.e. Error or RuntimeException.
      Parameters:
      unchecked - unchecked throwable.
    • ignoreThrowable

      public static void ignoreThrowable(Throwable throwable)
      Utility method to ignore non important exceptions.
      Parameters:
      throwable - throwable to ignore.