public final class ThrowableUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
detailedReason(Throwable e)
Equivalent to
detailedReason(e, 1) . |
static String |
detailedReason(Throwable e,
int maxCauses)
Same as
reason(java.lang.Throwable) except that the stack trace of specified
exception is integrated to returned message. |
static void |
detailedReason(Throwable e,
StringBuilder buffer)
Copies both the message and the stack trace of specified exception to
specified buffer.
|
static String |
reason(Throwable e)
Returns the message of specified exception.
|
static String |
reasonLine(Throwable e)
One line describing specified Throwable in a comprehensive way.
|
public static String reason(Throwable e)
public static String reasonLine(Throwable e)
More detailed than (single-line) reason(java.lang.Throwable)
and less detailed
than (multi-line) detailedReason(java.lang.Throwable)
.
public static String detailedReason(Throwable e)
detailedReason(e, 1)
.public static String detailedReason(Throwable e, int maxCauses)
reason(java.lang.Throwable)
except that the stack trace of specified
exception is integrated to returned message.e
- the Throwable to be formattedmaxCauses
- in case of a chained Throwable,
maximum number of causes (Throwable.getCause()
)
to be included in the formatted stringpublic static void detailedReason(Throwable e, StringBuilder buffer)