Class ThrowableUtil
java.lang.Object
io.netty.util.internal.ThrowableUtil
public final class ThrowableUtil
extends java.lang.Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddSuppressed(java.lang.Throwable target, java.lang.Throwable suppressed) static voidaddSuppressed(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed) static voidaddSuppressedAndClear(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed) static java.lang.Throwable[]getSuppressed(java.lang.Throwable source) static booleanDeprecated.static voidinterruptAndAttachAsyncStackTrace(java.lang.Thread thread, java.lang.Throwable cause) Capture the stack trace of the given thread, interrupt it, and attach the stack trace as a suppressed exception to the given cause.static java.lang.StringstackTraceToString(java.lang.Throwable cause) Deprecated.static <T extends java.lang.Throwable>
TunknownStackTrace(T cause, java.lang.Class<?> clazz, java.lang.String method) Set theStackTraceElementfor the givenThrowable, using theClassand method name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ThrowableUtil
private ThrowableUtil()
-
-
Method Details
-
unknownStackTrace
public static <T extends java.lang.Throwable> T unknownStackTrace(T cause, java.lang.Class<?> clazz, java.lang.String method) Set theStackTraceElementfor the givenThrowable, using theClassand method name. -
stackTraceToString
@Deprecated public static java.lang.String stackTraceToString(java.lang.Throwable cause) Deprecated.Gets the stack trace from a Throwable as a String.- Parameters:
cause- theThrowableto be examined- Returns:
- the stack trace as generated by
Throwable.printStackTrace(java.io.PrintWriter)method.
-
haveSuppressed
@Deprecated public static boolean haveSuppressed()Deprecated. -
addSuppressed
public static void addSuppressed(java.lang.Throwable target, java.lang.Throwable suppressed) -
addSuppressedAndClear
public static void addSuppressedAndClear(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed) -
addSuppressed
public static void addSuppressed(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed) -
getSuppressed
public static java.lang.Throwable[] getSuppressed(java.lang.Throwable source) -
interruptAndAttachAsyncStackTrace
public static void interruptAndAttachAsyncStackTrace(java.lang.Thread thread, java.lang.Throwable cause) Capture the stack trace of the given thread, interrupt it, and attach the stack trace as a suppressed exception to the given cause.- Parameters:
thread- The thread to interrupt.cause- The cause to attach a stack trace to.
-