Package com.atlassian.jira.util
Class ExceptionUtil
java.lang.Object
com.atlassian.jira.util.ExceptionUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic StringgetMessage(Throwable ex) Extracts the closest thing to an end-user-comprehensible message from an exception.static StringlogExceptionWithWarn(org.apache.log4j.Logger log, String message, Throwable ex) Logs the given exception.static StringlogExceptionWithWarn(org.slf4j.Logger log, String message, Throwable ex) Logs the given exception.
-
Constructor Details
-
ExceptionUtil
public ExceptionUtil()
-
-
Method Details
-
getMessage
Extracts the closest thing to an end-user-comprehensible message from an exception.- Parameters:
ex- exception to get message for.- Returns:
- string representing exception without stacktrace.
-
logExceptionWithWarn
public static String logExceptionWithWarn(@Nonnull org.slf4j.Logger log, String message, @Nonnull Throwable ex) Logs the given exception.- Parameters:
log- the target loggermessage- the message to logex- the exception to log- Returns:
- the logged message (not the given one)
-
logExceptionWithWarn
public static String logExceptionWithWarn(@Nonnull org.apache.log4j.Logger log, String message, @Nonnull Throwable ex) Logs the given exception.- Parameters:
log- the target loggermessage- the message to logex- the exception to log- Returns:
- the logged message (not the given one)
-
getExceptionAsHtml
-