private static RuntimeException cancelThrow ( ClientCall < ? , ? > call , Throwable t ) { try { call . cancel ( null , t ) ; } catch ( Throwable e ) { assert e instanceof RuntimeException || e instanceof Error ; logger . log ( Level . SEVERE , "RuntimeException encountered while closing call" , e ) ; } if ( t instanceof RuntimeException ) { throw ( RuntimeException ) t ; } else if ( t instanceof Error ) { throw ( Error ) t ; } // should be impossible throw new AssertionError ( t ) ; }
Cancels a call and throws the exception .