[New] Added ExceptionHelper.getRootCauseMessage(Throwable)

This commit is contained in:
Robert von Burg 2022-01-10 22:52:41 +01:00
parent 58fb8bb7fb
commit 7cb6b3acdc
1 changed files with 15 additions and 3 deletions

View File

@ -207,6 +207,18 @@ public class ExceptionHelper {
return t;
}
/**
* Returns {@link #getExceptionMessage(Throwable, boolean)} for the root cause of the given {@link Throwable}
*
* @param throwable
* the throwable for which to get the message of the root cause
*
* @return {@link #getExceptionMessage(Throwable, boolean)} for the root cause of the given {@link Throwable}
*/
public static String getRootCauseMessage(Throwable throwable) {
return getExceptionMessage(getRootCause(throwable), true);
}
/**
* Walks the causes for the given {@link Throwable} and sees if the given cause exists
*