Package org.instancio.internal.util
Class ExceptionHandler
java.lang.Object
org.instancio.internal.util.ExceptionHandler
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional<T>
conditionalFailOnError
(Supplier<T> supplier) static void
conditionalFailOnError
(VoidFunction function) static void
logException
(String msg, Throwable t, Object... args) Logs exception stacktrace if trace is enabled, otherwise log exception class name and message.static void
Run the providedaction
ignoring theNoClassDefFoundError
if it will be thrown.
-
Method Details
-
conditionalFailOnError
-
conditionalFailOnError
-
logException
Logs exception stacktrace if trace is enabled, otherwise log exception class name and message.- Parameters:
msg
- log messaget
- exception to logargs
- message arguments
-
runIgnoringTheNoClassDefFoundError
Run the providedaction
ignoring theNoClassDefFoundError
if it will be thrown.- Parameters:
action
- the provided action
-