Class ExceptionUtil

java.lang.Object
com.atlassian.jira.util.ExceptionUtil

public class ExceptionUtil extends Object
  • Constructor Details

    • ExceptionUtil

      public ExceptionUtil()
  • Method Details

    • getMessage

      public static String getMessage(Throwable ex)
      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 logger
      message - the message to log
      ex - 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 logger
      message - the message to log
      ex - the exception to log
      Returns:
      the logged message (not the given one)
    • getExceptionAsHtml

      public static String getExceptionAsHtml(SearchException e)