+ report + "</import>";
} catch (Exception e) {
result = "<?xml version=\"1.0\"?><import><msg>ERROR</msg><report>"
- + Tools.errorToString(e, true) + "</report></import>";
+ + e.getMessage() + "</report></import>";
}
return result;
}
+ report + "</import>";
} catch (Exception e) {
result = "<?xml version=\"1.0\"?><import><msg>ERROR</msg><report>"
- + Tools.errorToString(e, true) + "</report></import>";
+ + e.getMessage() + "</report></import>";
}
return result;
}
pipe.setWriter(writer);
DocumentTranslationMap dtm = pipe.run();
Map<DocumentRef, DocumentRef> documentRefs = dtm.getDocRefMap(); // FIXME: Should be checking for null here!
+ if (documentRefs != null && documentRefs.isEmpty()) {
+ throw new Exception("No valid records found in import payload. Check XML markup for not-well-formed errors, elements not matching import or document-specific schema, etc.");
+ }
dump.append("<importedRecords>");
for (Map.Entry<DocumentRef, DocumentRef> entry : documentRefs.entrySet()) {
keyDocRef = (DocumentRef) entry.getKey();