Class ExceptionHandler

java.lang.Object
org.instancio.internal.util.ExceptionHandler

public final class ExceptionHandler extends Object
  • Method Details

    • conditionalFailOnError

      public static <T> Optional<T> conditionalFailOnError(Supplier<T> supplier)
    • conditionalFailOnError

      public static void conditionalFailOnError(VoidFunction function)
    • logException

      public static void logException(String msg, Throwable t, Object... args)
      Logs exception stacktrace if trace is enabled, otherwise log exception class name and message.
      Parameters:
      msg - log message
      t - exception to log
      args - message arguments
    • runIgnoringTheNoClassDefFoundError

      public static void runIgnoringTheNoClassDefFoundError(Runnable action)
      Run the provided action ignoring the NoClassDefFoundError if it will be thrown.
      Parameters:
      action - the provided action