[New] Added ExceptionHelper.getRootCauseExceptionMessage()

This commit is contained in:
Robert von Burg 2024-04-23 10:32:43 +02:00
parent a45475f783
commit c4ac21ec98
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 11 additions and 0 deletions

View File

@ -52,6 +52,17 @@ public class ExceptionHelper {
.orElse("UnknownClass.unknownMethod!");
}
/**
* Returns the message of the root cause of the given exception
*
* @param e the exception for which to get the root cause
*
* @return the message of the root cause of the given exception
*/
public static String getRootCauseExceptionMessage(Throwable e) {
return getExceptionMessage(getRootCause(e), false);
}
/**
* <p>
* Returns a message for the given {@link Throwable}