Class ExceptionUtil
- Since:
- 2.0.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ExceptionUtil.ExceptionMessage> getExceptionMessageList(Throwable throwable) Gets a list made of all exceptions classes and their message found in an exception stack, starting with the supplied exception itself.static StringgetFormattedMessages(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.getMessageList(Throwable throwable) Gets a list of short messages summarizing all exceptions objects in the exception chain, starting with and including the supplied exception.
-
Method Details
-
getFormattedMessages
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
nullmessages are returned as empty strings.This method handles infinite loops. A
nullexception returns an empty string (nevernull).- Parameters:
throwable- the throwable to inspect, may benull- Returns:
- formatted string or empty string, never
null
-
getMessageList
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
nullmessages are returned as empty strings.This method handles infinite loops and never returns
null.- Parameters:
throwable- the throwable to inspect, may benull- Returns:
- the list of messages, never
null
-
getExceptionMessageList
Gets a list made of all exceptions classes and their message found in an exception stack, starting with the supplied exception itself.
Exceptions without a message will result in a
nullmap value.This method handles infinite loops and never returns
null.- Parameters:
throwable- the throwable to inspect, may benull- Returns:
- the list of messages, never
null
-