public class ThrowableUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MIN_MESSAGE_SIZE
Minimum size for a single message to be meaningful.
|
| Constructor and Description |
|---|
ThrowableUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.StringBuilder |
buildErrorMessage(java.util.Collection<java.lang.String> messages)
Build an error message given a collection of messages using the following pattern: msg0 (msg1 (msg2 (msg3)))
|
static java.lang.String |
getErrorMessage(java.lang.Throwable t) |
static java.lang.String |
getErrorMessage(java.lang.Throwable t,
int maxSize)
Generates an error message composed of each message from the hierarchy of causes.
|
public static final int MIN_MESSAGE_SIZE
public static java.lang.String getErrorMessage(java.lang.Throwable t)
public static java.lang.String getErrorMessage(java.lang.Throwable t,
int maxSize)
t - The root throwablemaxSize - The maximum size of the generated message. Each message will be truncated in the middle if the generated message is longer than maxSize. Must be more than 3, else an IllegalArgumentException is thrown.public static java.lang.StringBuilder buildErrorMessage(java.util.Collection<java.lang.String> messages)
messages - The collection of message to use for the generation