Class ThrowableUtil

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

public final class ThrowableUtil extends java.lang.Object
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addSuppressed(java.lang.Throwable target, java.lang.Throwable suppressed)
     
    static void
    addSuppressed(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed)
     
    static void
    addSuppressedAndClear(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed)
     
    static java.lang.Throwable[]
    getSuppressed(java.lang.Throwable source)
     
    static boolean
    Deprecated.
    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.
    static java.lang.String
    stackTraceToString(java.lang.Throwable cause)
    Deprecated.
    static <T extends java.lang.Throwable>
    T
    unknownStackTrace(T cause, java.lang.Class<?> clazz, java.lang.String method)
    Set the StackTraceElement for the given Throwable, using the Class and 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 the StackTraceElement for the given Throwable, using the Class and 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 - the Throwable to 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.