List < Throwable > function ( Throwable arg0 ) { checkNotNull ( arg0 ) ; List < Throwable > loc0 = new ArrayList < Throwable > ( 4 ) ; while ( arg0 != null ) { loc0 . add ( arg0 ) ; arg0 = arg0 . getCause ( ) ; } return Collections . unmodifiableList ( loc0 ) ; }
gets a throwable cause chain as a list . the first entry in thelist will be throwable followed by its cause hierarchy . notethat this is a snapshot of the cause chain and will not reflect any subsequent changes to the cause chain . here 's an example of how it can be used to find specific types of exceptions in the cause chain : iterables.filter throwables.getcausalchain e , ioexception.class ; concode_field_sep PlaceHolder placeHolder concode_field_sep void propagateIfPossible concode_elem_sep void propagateIfPossible concode_elem_sep void propagateIfPossible concode_elem_sep RuntimeException propagate concode_elem_sep void propagateIfInstanceOf concode_elem_sep Throwable getRootCause concode_elem_sep String getStackTraceAsString