public synchronized void transferError ( Exception e ) { logger . debug ( "intercepted exception" , e ) ; if ( transferException == null ) { transferException = e ; } else if ( transferException instanceof InterruptedException || transferException instanceof InterruptedIOException ) { //if one of the threads throws an error, it interrupts //the other thread (by InterruptedException). //Here we make sure that transferException will store the //primary failure reason, not the resulting InterruptedException transferException = e ; } notifyAll ( ) ; }
this is called when an error occurs during transfer