public class ExceptionUtil extends Object
Constructor and Description |
---|
ExceptionUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
generateStackTrace(Throwable exception)
Returns the string representation of the stacktrace of the passed
exception |
static Throwable |
getRootCause(Throwable exception) |
static String |
rootCauseFirstStackTrace(Throwable exception)
Returns a "upside down" stacktrace of the
exception with the root
cause showing up first in the stacktrace. |
public static String generateStackTrace(Throwable exception)
exception
exception
- public static String rootCauseFirstStackTrace(Throwable exception)
exception
with the root
cause showing up first in the stacktrace.
Note: This is a relatively expensive method because it creates additional
exceptions and manipulates their stacktraces. Care should be taken to determine whether
usage of this method is necessary.exception
- The exceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.