com.ibm.websphere.ras
Class TruncatableThrowable
java.lang.Object
java.lang.Throwable
com.ibm.websphere.ras.TruncatableThrowable
- All Implemented Interfaces:
- java.io.Serializable
public class TruncatableThrowable
- extends java.lang.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:
- Serialized Form
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, initCause, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CAUSED_BY
public static final java.lang.String CAUSED_BY
- See Also:
- Constant Field Values
INTERNAL_CLASSES_STRING
public static final java.lang.String INTERNAL_CLASSES_STRING
- See Also:
- Constant Field Values
TruncatableThrowable
public TruncatableThrowable(java.lang.Throwable wrapped)
printStackTrace
public void printStackTrace(java.io.PrintStream stream)
- Overrides:
printStackTrace
in class java.lang.Throwable
printStackTrace
public void printStackTrace(java.io.PrintWriter p)
- This method will print a trimmed stack trace to stderr.
- Overrides:
printStackTrace
in class java.lang.Throwable
getCause
public TruncatableThrowable getCause()
- Overrides:
getCause
in class java.lang.Throwable
getStackTrace
public java.lang.StackTraceElement[] getStackTrace()
- Overrides:
getStackTrace
in class java.lang.Throwable
getStackTraceEliminatingDuplicateFrames
public java.lang.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 java.lang.Throwable getWrappedException()
- Returns:
getMessage
public java.lang.String getMessage()
- Overrides:
getMessage
in class java.lang.Throwable
printStackTraceElement
public static java.lang.String printStackTraceElement(java.lang.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 java.lang.String toString()
- Overrides:
toString
in class java.lang.Throwable