// assume out of space of something permanent, abandon
outcome = "Write failed: " + e.getMessage();
ExternalSeedException error = new ExternalSeedException( outcome, e );
error.setPermanentFailure( true );
throw( error );
}
}
listener.reportBytesRead( len );
requests_outstanding = checkRequests();
}
checkRequests();
}else{
outcome = "Connection failed: " + connection.getResponseMessage();
ExternalSeedException error = new ExternalSeedException( outcome );
error.setPermanentFailure( true );
throw( error );
}
}catch( IOException e ){
if ( con_fail_is_perm_fail && !connected ){
outcome = "Connection failed: " + e.getMessage();
ExternalSeedException error = new ExternalSeedException( outcome );
error.setPermanentFailure( true );
throw( error );
}else{
outcome = "Connection failed: " + Debug.getNestedExceptionMessage( e );
if ( last_response_retry_after_secs >= 0){
outcome += ", Retry-After: " + last_response_retry_after_secs + " seconds";
}
ExternalSeedException excep = new ExternalSeedException( outcome, e );
if ( e instanceof FileNotFoundException ){
excep.setPermanentFailure( true );
}
throw( excep );
}
}catch( ExternalSeedException e ){
throw( e );
}catch( Throwable e ){
if ( e instanceof ExternalSeedException ){
throw((ExternalSeedException)e);
}
outcome = "Connection failed: " + Debug.getNestedExceptionMessage( e );
throw( new ExternalSeedException("Connection failed", e ));
}finally{
SESecurityManager.unsetThreadPasswordHandler();