Package org.openjdk.jmc.common.util
Class ExceptionToolkit
java.lang.Object
org.openjdk.jmc.common.util.ExceptionToolkit
Toolkit for working with exceptions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns a string with the text fromThrowable.printStackTrace()
.static String
Returns a string with a text equivalent toThrowable.printStackTrace()
, but with a limited number of frames.
-
Constructor Details
-
ExceptionToolkit
public ExceptionToolkit()
-
-
Method Details
-
toString
Returns a string with the text fromThrowable.printStackTrace()
. The string will end with a line break.- Parameters:
t
-Throwable
to get the stack trace from- Returns:
- a string with the stack trace
-
toString
Returns a string with a text equivalent toThrowable.printStackTrace()
, but with a limited number of frames. The string will end with a line break.- Parameters:
t
-Throwable
to get the stack trace frommaxFrames
- The max number of frames to include in the string. If there are more frames in the stack trace, then an ellipsis is added at the end.- Returns:
- a string with the stack trace
-