Package com.linkedin.venice.utils
Class ExceptionUtils
java.lang.Object
com.linkedin.venice.utils.ExceptionUtils
Static utility functions to deal with exceptions.
Copied from here:
https://github.com/voldemort/voldemort/blob/ea37ef67fa7724180608510c6d4237167b78dd63/src/java/voldemort/utils/ExceptionUtils.java
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
compactExceptionDescription
(Throwable t, String originatingFunctionName) static void
logClassLoaderContent
(String packageName) static boolean
recursiveClassEquals
(Throwable throwableToInspect, Class... throwableClassesToLookFor) Inspects a givenThrowable
as well as its nested causes, in order to look for a specific set of exception classes.static boolean
recursiveMessageContains
(Throwable throwableToInspect, String message) Inspects a givenThrowable
as well as its nested causes, in order to look for a specific message.static String
stackTraceToString
(Throwable throwable) static String
threadToThrowableToString
(Thread thread)
-
Constructor Details
-
ExceptionUtils
public ExceptionUtils()
-
-
Method Details
-
recursiveClassEquals
public static boolean recursiveClassEquals(Throwable throwableToInspect, Class... throwableClassesToLookFor) Inspects a givenThrowable
as well as its nested causes, in order to look for a specific set of exception classes. The function also detects if the throwable to inspect is a subclass of one of the classes you look for, but not the other way around (i.e.: if you're looking for the subclass but the throwableToInspect is the parent class, then this function returns false).- Returns:
- true if the throwableToInspect corresponds to or is caused by any of the throwableClassesToLookFor
-
recursiveMessageContains
Inspects a givenThrowable
as well as its nested causes, in order to look for a specific message.- Returns:
- true if the throwableToInspect contains the message parameter
-
stackTraceToString
- Returns:
- a String representation of the provided throwable's stacktrace.
-
threadToThrowableToString
-
logClassLoaderContent
-
compactExceptionDescription
-
compactExceptionDescription
-