public class ExceptionUtils
extends org.apache.commons.lang3.exception.ExceptionUtils
Constructor and Description |
---|
ExceptionUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsType(Throwable throwable,
Class<?> type)
This method returns true if the throwable contains a
Throwable that
matches the specified class or subclass in the exception chain. |
static <ET> ET |
getDeepestOccurenceOfType(Throwable throwable,
Class<ET> type)
This method returns the throwable closest to the root cause that matches the
specified class or subclass.
|
static String |
getFullStackTraceWithoutMessages(Throwable throwable)
Similar to
#getFullStackTrace(Throwable) but removing the exception and causes
messages. |
getCause, getCause, getDefaultCauseMethodNames, getMessage, getRootCause, getRootCauseMessage, getRootCauseStackTrace, getStackFrames, getStackTrace, getThrowableCount, getThrowableList, getThrowables, hasCause, indexOfThrowable, indexOfThrowable, indexOfType, indexOfType, printRootCauseStackTrace, printRootCauseStackTrace, printRootCauseStackTrace, removeCommonFrames, rethrow, wrapAndThrow
public static boolean containsType(Throwable throwable, Class<?> type)
Throwable
that
matches the specified class or subclass in the exception chain. Subclasses of
the specified class do match.throwable
- the throwable to inspect, may be nulltype
- the type to search for, subclasses match, null returns falsepublic static <ET> ET getDeepestOccurenceOfType(Throwable throwable, Class<ET> type)
throwable
- the throwable to inspect, may be nulltype
- the type to search for, subclasses match, null returns nullpublic static String getFullStackTraceWithoutMessages(Throwable throwable)
#getFullStackTrace(Throwable)
but removing the exception and causes
messages. This is useful to determine if two exceptions have matching stack traces regardless of
the messages which may contain invokation specific datathrowable
- the throwable to inspect, may be null
null
Copyright © 2003–2018 MuleSoft, Inc.. All rights reserved.