Class Throwables


  • public final class Throwables
    extends Object
    Provides helper methods to work with Throwable objects.
    Since:
    2.0
    • Method Detail

      • findThrowableInChain

        public static Optional<Throwable> findThrowableInChain​(Predicate<Throwable> condition,
                                                               @Nullable Throwable t)
        Search an exception chain for an exception matching a given condition.
        Parameters:
        condition - The condition to match on
        t - The head of the exception chain
        Returns:
        An Optional containing the first match in the chain, starting from the head, or empty if no matching exception was found
        Since:
        2.1.0