Class ExceptionUtil


  • public class ExceptionUtil
    extends Object
    • Constructor Detail

      • ExceptionUtil

        public ExceptionUtil()
    • Method Detail

      • generateStackTrace

        public static String generateStackTrace​(Throwable exception)
        Returns the string representation of the stacktrace of the passed exception
        Parameters:
        exception -
        Returns:
      • rootCauseFirstStackTrace

        public static String rootCauseFirstStackTrace​(Throwable exception)
        Returns a "upside down" stacktrace of the exception with the root cause showing up first in the stacktrace. Note: This is a relatively expensive method because it creates additional exceptions and manipulates their stacktraces. Care should be taken to determine whether usage of this method is necessary.
        Parameters:
        exception - The exception
        Returns: