Class ExceptionUtils


  • public class ExceptionUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ExceptionUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getFilteredStackTrace​(java.lang.Throwable t)
      Simple util to get stack trace.
      static java.lang.String getStackTrace​(java.lang.Throwable t)
      Get the full stacktrace as a string
      static java.lang.String trimMessage​(java.lang.String trace)
      Utility method to trim the message from a stack trace string.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExceptionUtils

        public ExceptionUtils()
    • Method Detail

      • getFilteredStackTrace

        public static java.lang.String getFilteredStackTrace​(java.lang.Throwable t)
        Simple util to get stack trace.

        This will unwrap a TikaException and return the cause if not null

        NOTE: If your stacktraces are truncated, make sure to start your jvm with: -XX:-OmitStackTraceInFastThrow

        Parameters:
        t - throwable
        Returns:
        Throws:
        java.io.IOException
      • getStackTrace

        public static java.lang.String getStackTrace​(java.lang.Throwable t)
        Get the full stacktrace as a string
        Parameters:
        t -
        Returns:
      • trimMessage

        public static java.lang.String trimMessage​(java.lang.String trace)
        Utility method to trim the message from a stack trace string.

        E.g. java.lang.IllegalStateException: Potential loop detected will be trimmed to java.lang.IllegalStateException

        Parameters:
        trace - string view of stack trace
        Returns:
        trimmed stack trace