Class ThrowableUtil

java.lang.Object
io.netty.util.internal.ThrowableUtil

public final class ThrowableUtil extends Object
  • Method Details

    • unknownStackTrace

      public static <T extends Throwable> T unknownStackTrace(T cause, Class<?> clazz, String method)
      Set the StackTraceElement for the given Throwable, using the Class and method name.
    • stackTraceToString

      public static String stackTraceToString(Throwable cause)
      Gets the stack trace from a Throwable as a String.
      Parameters:
      cause - the Throwable to be examined
      Returns:
      the stack trace as generated by Throwable.printStackTrace(java.io.PrintWriter) method.
    • haveSuppressed

      public static boolean haveSuppressed()
    • addSuppressed

      public static void addSuppressed(Throwable target, Throwable suppressed)
    • addSuppressedAndClear

      public static void addSuppressedAndClear(Throwable target, List<Throwable> suppressed)
    • addSuppressed

      public static void addSuppressed(Throwable target, List<Throwable> suppressed)
    • getSuppressed

      public static Throwable[] getSuppressed(Throwable source)
    • interruptAndAttachAsyncStackTrace

      public static void interruptAndAttachAsyncStackTrace(Thread thread, 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.