public class ExceptionToolkit extends Object
Constructor and Description |
---|
ExceptionToolkit() |
Modifier and Type | Method and Description |
---|---|
static String |
toString(Throwable t)
Returns a string with the text from
Throwable.printStackTrace() . |
static String |
toString(Throwable t,
int maxFrames)
Returns a string with a text equivalent to
Throwable.printStackTrace() , but with a
limited number of frames. |
public static String toString(Throwable t)
Throwable.printStackTrace()
. The string will end
with a line break.t
- Throwable
to get the stack trace frompublic static String toString(Throwable t, int maxFrames)
Throwable.printStackTrace()
, but with a
limited number of frames. The string will end with a line break.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.Copyright © 2020. All rights reserved.