Class TruncatableThrowable

java.lang.Object
java.lang.Throwable
com.ibm.websphere.ras.TruncatableThrowable
All Implemented Interfaces:
Serializable

public class TruncatableThrowable extends Throwable
An exception which can produce trimmed stack traces. If passed as a parameter to the logger, it will output the trimmed stack traces to the console, and the full stack traces to messages.log and trace.log. To get full stack traces, call getWrappedException() and then call Throwable.printStackTrace() on the returned exception.
See Also:
  • Field Details

  • Constructor Details

    • TruncatableThrowable

      public TruncatableThrowable(Throwable wrapped)
  • Method Details

    • printStackTrace

      public void printStackTrace(PrintStream stream)
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintWriter p)
      This method will print a trimmed stack trace to stderr.
      Overrides:
      printStackTrace in class Throwable
    • getCause

      public TruncatableThrowable getCause()
      Overrides:
      getCause in class Throwable
    • getStackTrace

      public StackTraceElement[] getStackTrace()
      Overrides:
      getStackTrace in class Throwable
    • getStackTraceEliminatingDuplicateFrames

      public StackTraceElement[] getStackTraceEliminatingDuplicateFrames()
      Useful for exceptions which are the causes of other exceptions. Gets the stack frames, but not only does it eliminate internal classes, it eliminates frames which are redundant with the parent exception. In the case where the exception is not a cause, it returns a normal exception. If duplicate frames are stripped, it will add an
      Returns:
    • getWrappedException

      public Throwable getWrappedException()
      Returns:
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • printStackTraceElement

      public static String printStackTraceElement(StackTraceElement stackTraceElement)
      Unfortunately, toString() isn't good enough since we may have elements in the stack representing internal classes, and they don't toString() well.
    • toString

      public String toString()
      Overrides:
      toString in class Throwable