throw new RuntimeException(
"No shopping cart found."
+ " Please checkout one first.");
}
SchemaValidator validator = new SchemaValidator();
SchemaValidationResult validationResult =
validator.validate(getMendozaState().getShoppingCart());
if (!validationResult.isXmlValid()) {
log.trace("Leaving execute");
throw new RuntimeException(
"The shopping cart XML is not valid. "
+ validationResult.getMessage());
}
result.setSuccess(commandResultMsg);
} catch (RuntimeException e) {
commandResultMsg = e.getMessage();
result.setError(commandResultMsg);