import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.cdm.api.service.IProgressMonitorService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
import eu.etaxonomy.taxeditor.operation.IFeedbackGenerator;
import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
}
// if the total work is still not been set then we assume that the
// operation has zero work units
- if(remotingMonitor.getTotalWork() == 0) {
+ if(remotingMonitor.getTotalWork() == 0 && remotingMonitor.isDone()) {
+ return remotingMonitor;
+// throw new InterruptedException("Monitor has zero work units");
+ }else if (remotingMonitor.getTotalWork() == 0 ){
throw new InterruptedException("Monitor has zero work units");
}
// start the client monitor
// the remoting monitor is waiting on feedback
// then throw exception
if(feedbackCount + 1 > feedbackGenerators.size()) {
- throw new IllegalStateException("Remoting monitor waiting on feedback that does not exist");
+ IllegalStateException exception = new IllegalStateException("Remoting monitor waiting on feedback that does not exist");
+ Object result = remotingMonitor.getResult();
+ if (result instanceof UpdateResult){
+ ((UpdateResult)result).addException(exception);
+ }
+
}
feedbackGenerators.get(feedbackCount).setFeedbackForMonitor(uuid);
feedbackCount++;
editorTotalWorkDone = serverTotalWorkDone;
}
if(remotingMonitor.getResult() instanceof Exception) {
- throw new IllegalStateException((Exception)remotingMonitor.getResult());
+ UpdateResult result = new UpdateResult();
+ result.addException((Exception) remotingMonitor.getResult());
+// throw new IllegalStateException((Exception)remotingMonitor.getResult());
}
return remotingMonitor;
} finally {