} catch (Throwable t) {
log.error("Failed to send operation succeeded message to server. resource=[" + resourceId
+ "], operation=[" + operationName + "], jobId=[" + jobId + "]", t);
}
} else {
ExceptionPackage errorResults = new ExceptionPackage(Severity.Severe, new Exception(errorMessage));
try {
operationServerService.operationFailed(jobId, result, errorResults, invocationTime,
finishedTime);
} catch (Throwable t) {
log.error("Failed to send operation failed message to server. resource=[" + resourceId
+ "], operation=[" + operationName + "], jobId=[" + jobId + "]", t);
}
}
} else {
if (status.contains(Status.TIMED_OUT)) {
try {
operationServerService.operationTimedOut(jobId, invocationTime, finishedTime);
} catch (Throwable t) {
log.error("Failed to send operation timed out message to server. resource=[" + resourceId
+ "], operation=[" + operationName + "], jobId=[" + jobId + "]", t);
}
} else {
ExceptionPackage errorResults;
if (status.contains(Status.CANCELED)) {
errorResults = new ExceptionPackage(Severity.Info, new Exception("Canceled", failure));
} else {
errorResults = new ExceptionPackage(Severity.Severe, failure);
}
try {
if (status.contains(Status.CANCELED)) {
operationServerService.operationCanceled(jobId, null, errorResults, invocationTime,
finishedTime);
} else {
operationServerService.operationFailed(jobId, null, errorResults, invocationTime,
finishedTime);
}
} catch (Throwable t) {
log.error("Failed to send operation failed message to server. resource=[" + resourceId
+ "], operation=[" + operationName + "], jobId=[" + jobId + "], operation-error=["
+ errorResults.toString() + "]", t);
}
}
}
}