public final class ExceptionUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getFormattedMessages(Throwable throwable)
Gets a formatted string made of short messages summarizing all
exceptions objects in the exception chain, starting with and including
the supplied
exception.
|
static List<String> |
getMessageList(Throwable throwable)
Gets a list of short messages summarizing all exceptions objects
in the exception chain, starting with and including the supplied
exception.
|
public static String getFormattedMessages(Throwable throwable)
Gets a formatted string made of short messages summarizing all exceptions objects in the exception chain, starting with and including the supplied exception.
Each messages returned are in the form
{ClassNameWithoutPackage}: {ThrowableMessage}.
Exceptions with null
messages are
returned as empty strings.
This method handles infinite loops. A null
exception
returns an empty string (never null
).
throwable
- the throwable to inspect, may be null
null
public static List<String> getMessageList(Throwable throwable)
Gets a list of short messages summarizing all exceptions objects in the exception chain, starting with and including the supplied exception.
Each messages returned are in the form
{ClassNameWithoutPackage}: {ThrowableMessage}.
Exceptions with null
messages are
returned as empty strings.
This method handles infinite loops and never returns
null
.
throwable
- the throwable to inspect, may be null
null
Copyright © 2008–2023 Norconex Inc.. All rights reserved.