Class ExceptionUtils
java.lang.Object
com.polarion.core.util.exceptions.ExceptionUtils
- Author:
- Michal Dobisek, Polarion Software
-
Method Summary
Modifier and TypeMethodDescriptionstatic Throwable
static Throwable
findException
(Throwable throwable, Class<?> type) This method returns the same object asfindExceptionByType(Throwable, Class)
, but it may be more useful if you are looking for an exception implementing an interface, but you want to make use of the Throwable class (without casting).static <T> T
findExceptionByType
(Throwable throwable, Class<T> type) Returns the first Throwable class that matches the specified class (subclasses match) in the chain of exception causes, starting from the given Throwable.static InvocationTargetException
findInvocationTargetException
(Throwable throwable) static Throwable
static String
static String
Traverses the exception stack and creates the report from their causes, in form:static String
static String
static String
-
Method Details
-
getCausesString
Traverses the exception stack and creates the report from their causes, in form:ExceptionType: message caused by: ExceptionType: message caused by: ExceptionType: message ...
-
handleUserFriendlyExceptions
-
getMessage
-
getCauseMessage
-
findException
@Nullable public static Throwable findException(@Nullable Throwable throwable, @NotNull Class<?> type) This method returns the same object asfindExceptionByType(Throwable, Class)
, but it may be more useful if you are looking for an exception implementing an interface, but you want to make use of the Throwable class (without casting). -
findExceptionByType
@Nullable public static <T> T findExceptionByType(@Nullable Throwable throwable, @NotNull Class<T> type) Returns the first Throwable class that matches the specified class (subclasses match) in the chain of exception causes, starting from the given Throwable.- Since:
- 3.22.1
-
findInvocationTargetException
@Nullable public static InvocationTargetException findInvocationTargetException(@Nullable Throwable throwable) -
findDeapestCause
-
getCause
-
getStackTrace
-