public static void saveErrorDetails(
JobExecutionContext jobExecutionContext, String errorMessage,
CorrectiveAction action, ErrorCategory errorCatogory)
throws GFacException {
try {
Registry registry = RegistryFactory.getDefaultRegistry();
ErrorDetails details = new ErrorDetails();
details.setActualErrorMessage(errorMessage);
details.setCorrectiveAction(action);
details.setActionableGroup(ActionableGroup.GATEWAYS_ADMINS);
details.setCreationTime(Calendar.getInstance().getTimeInMillis());
details.setErrorCategory(errorCatogory);
registry.add(ChildDataType.ERROR_DETAIL, details,
jobExecutionContext.getTaskData().getTaskID());
} catch (Exception e) {
throw new GFacException("Error persisting job status"
+ e.getLocalizedMessage(), e);
}