public static List < Throwable > getCauseChain ( Throwable exception ) { Assert . notNull ( exception ) ; List < Throwable > result = new ArrayList <> ( ) ; collectCauseChain ( exception , result ) ; return result ; }
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 .