Package com.ibm.websphere.ras
Class TruncatableThrowable
java.lang.Object
java.lang.Throwable
com.ibm.websphere.ras.TruncatableThrowable
- All Implemented Interfaces:
Serializable
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
Useful for exceptions which are the causes of other exceptions.void
printStackTrace
(PrintStream stream) void
This method will print a trimmed stack trace to stderr.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()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getSuppressed, initCause, printStackTrace, setStackTrace
-
Field Details
-
CAUSED_BY
- See Also:
-
INTERNAL_CLASSES_STRING
- See Also:
-
-
Constructor Details
-
TruncatableThrowable
-
-
Method Details
-
printStackTrace
- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
This method will print a trimmed stack trace to stderr.- Overrides:
printStackTrace
in classThrowable
-
getCause
-
getStackTrace
- Overrides:
getStackTrace
in classThrowable
-
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
- Returns:
-
getMessage
- Overrides:
getMessage
in classThrowable
-
printStackTraceElement
Unfortunately, toString() isn't good enough since we may have elements in the stack representing internal classes, and they don't toString() well. -
toString
-