public class ThrowableUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getAllMessages(Throwable t)
Same as
getAllMessages(Throwable, boolean) with the "include exception name" parameter set to
true. |
static String |
getAllMessages(Throwable t,
boolean includeExceptionName)
Returns all the messages for the throwable and all of its causes in one long string.
|
static String |
getAllMessages(Throwable t,
boolean includeExceptionNames,
int maxSize)
Generates a string with all exception messages similarly to
getAllMessages(Throwable, boolean)
but limits the length of the string to the provided limit. |
static String[] |
getAllMessagesArray(Throwable t)
Same as
getAllMessagesArray(Throwable, boolean) with the "include exception name" parameter set to
true. |
static String[] |
getAllMessagesArray(Throwable t,
boolean includeExceptionName)
Returns all the messages for the throwable and all of its causes.
|
static String |
getAllSqlExceptionMessages(SQLException t)
Same as
#getAllSqlExceptionMessages(Throwable, boolean) with the "include exception name" parameter set
to true. |
static String |
getAllSqlExceptionMessages(SQLException t,
boolean includeExceptionName)
Returns all the messages for the SQL Exception and all of its next exceptions in one long string.
|
static String[] |
getAllSqlExceptionMessagesArray(SQLException t)
Same as
getAllSqlExceptionMessagesArray(SQLException, boolean) with the "include exception name"
parameter set to true. |
static String[] |
getAllSqlExceptionMessagesArray(SQLException t,
boolean includeExceptionName)
Returns all the messages for the SQL Exception and all of its causes.
|
static String |
getFilteredStackAsString(Throwable t)
The same as calling
getFilteredStackAsString(t, "org.rhq") |
static String |
getFilteredStackAsString(Throwable t,
String filter)
Returns the stack for
t, filtering out all StackTraceElement's that don't start
with filter. |
static Throwable |
getRootCause(Throwable t) |
static String |
getRootMessage(Throwable t) |
static String |
getStackAsString(Throwable t) |
public static String getAllMessages(Throwable t, boolean includeExceptionName)
t - the top throwable (may be null)includeExceptionName - if true, the exception name will prefix all messagespublic static final String getAllMessages(Throwable t, boolean includeExceptionNames, int maxSize)
getAllMessages(Throwable, boolean)
but limits the length of the string to the provided limit.
The messages are left out of the resulting string in the following manner:
t - includeExceptionNames - maxSize - the maximum size of the message. If < 0, the output is not limited.public static String getAllMessages(Throwable t)
getAllMessages(Throwable, boolean) with the "include exception name" parameter set to
true.t - the top throwable (may be null)public static String[] getAllMessagesArray(Throwable t, boolean includeExceptionName)
t - the top throwable (may be null)includeExceptionName - if true, the exception name will prefix all messagespublic static String[] getAllMessagesArray(Throwable t)
getAllMessagesArray(Throwable, boolean) with the "include exception name" parameter set to
true.t - the top throwable (may be null)public static String getAllSqlExceptionMessages(SQLException t, boolean includeExceptionName)
t - the top SQL Exception (may be null)includeExceptionName - if true, the exception name will prefix all messagespublic static String getAllSqlExceptionMessages(SQLException t)
#getAllSqlExceptionMessages(Throwable, boolean) with the "include exception name" parameter set
to true.t - the top sql exception (may be null)public static String[] getAllSqlExceptionMessagesArray(SQLException t, boolean includeExceptionName)
t - the top SQL Exception (may be null)includeExceptionName - if true, the exception name will prefix all messagespublic static String[] getAllSqlExceptionMessagesArray(SQLException t)
getAllSqlExceptionMessagesArray(SQLException, boolean) with the "include exception name"
parameter set to true.t - the top sql exception (may be null)public static String getFilteredStackAsString(Throwable t)
getFilteredStackAsString(t, "org.rhq")t - public static String getFilteredStackAsString(Throwable t, String filter)
t, filtering out all StackTraceElement's that don't start
with filter.t - filter - Not NullCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.