public List < Throwable > getCauses ( Throwable t ) { List < Throwable > causes = new LinkedList < Throwable > ( ) ; Throwable next = t ; while ( next . getCause ( ) != null ) { next = next . getCause ( ) ; causes . add ( next ) ; } return causes ; }
Convert a Throwable into a list containing all of its causes .