Package spock.util

Class Exceptions

  • public abstract class Exceptions
    extends Object
    • Constructor Detail

      • Exceptions

        public Exceptions()
    • Method Detail

      • getRootCause

        public static Throwable getRootCause​(Throwable exception)
        Returns the innermost cause of the specified exception. If the specified exception has no cause, the exception itself is returned.
        exception - an exception
        the root cause of the exception
      • getCauseChain

        public static List<Throwable> getCauseChain​(Throwable exception)
        Returns a list of all causes of the specified exception. The first element of the returned list is the specified exception itself; the last element is its root cause.
        exception - an exception
        the exception's cause chain