Validation validation = new Validation("unknown");
List<String> probs = new ArrayList<String>();
probs.add("Schematron validation failed:" + e.getMessage());
validation.setObjectProblems(probs);
logger.error("Schematron validation failed", e);
throw new ObjectValidityException(e.getMessage(), validation);
}
if (!result.isValid()) {
String msg = null;
try {
msg = result.getXMLResult();
} catch (Exception e) {
logger.warn("Error getting XML result of schematron validation failure", e);
}
Validation validation = new Validation("unknown");
List<String> probs = new ArrayList<String>();
if (msg != null) {
probs.add(msg);
} else {
probs.add("Unknown schematron error. Error getting XML results of schematron validation");
}
throw new ObjectValidityException(msg, validation);
}
}