Package io.quarkus.runtime.util
Class ExceptionUtil
java.lang.Object
io.quarkus.runtime.util.ExceptionUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
generateStackTrace
(Throwable exception) Returns the string representation of the stacktrace of the passedexception
static Throwable
getRootCause
(Throwable exception) static <T> boolean
isAnyCauseInstanceOf
(Throwable exception, Class<T> classToCheck) static String
rootCauseFirstStackTrace
(Throwable exception) Returns an "upside down" stacktrace of theexception
with the root cause showing up first in the stacktrace.
-
Constructor Details
-
ExceptionUtil
public ExceptionUtil()
-
-
Method Details
-
generateStackTrace
Returns the string representation of the stacktrace of the passedexception
- Parameters:
exception
-- Returns:
-
rootCauseFirstStackTrace
Returns an "upside down" stacktrace of theexception
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 stacktrace. Care should be taken to determine whether usage of this method is necessary.- Parameters:
exception
- The exception- Returns:
-
getRootCause
-
isAnyCauseInstanceOf
-