Class ThrowableUtils

  • public class ThrowableUtils
    extends Object
    Utility methods to help when working with Throwable instances.
    • Method Detail

      • chain

        public static <T extends Throwable,​T1 extends T,​T2 extends T> T chain​(@CheckForNull
                                                                                          T1 e1,
                                                                                          T2 e2)
        Allows building a chain of exceptions.
        Type Parameters:
        T - The widened return type.
        T1 - The type of first exception.
        T2 - The type of second exception.
        e1 - The first exception (or null).
        e2 - The second exception (or null).
        The first exception with the second added as a suppressed exception or the closest approximation to that.