improve error messages when rendering bundles that are documents that aren't properly formed
This commit is contained in:
parent
532aba2485
commit
1372d58ad4
|
@ -63,7 +63,7 @@ public class BundleRenderer extends ResourceRenderer {
|
||||||
List<BaseWrapper> entries = b.children("entry");
|
List<BaseWrapper> entries = b.children("entry");
|
||||||
if ("document".equals(b.get("type").primitiveValue())) {
|
if ("document".equals(b.get("type").primitiveValue())) {
|
||||||
if (entries.isEmpty() || (entries.get(0).has("resource") && "Composition".equals(entries.get(0).get("resource").fhirType())))
|
if (entries.isEmpty() || (entries.get(0).has("resource") && "Composition".equals(entries.get(0).get("resource").fhirType())))
|
||||||
throw new FHIRException("Invalid document - first entry is not a Composition");
|
throw new FHIRException("Invalid document '"+b.getId()+"' - first entry is not a Composition ('"+entries.get(0).get("resource").fhirType()+"')");
|
||||||
return renderDocument(x, b, entries);
|
return renderDocument(x, b, entries);
|
||||||
} else if ("collection".equals(b.get("type").primitiveValue()) && allEntriesAreHistoryProvenance(entries)) {
|
} else if ("collection".equals(b.get("type").primitiveValue()) && allEntriesAreHistoryProvenance(entries)) {
|
||||||
// nothing
|
// nothing
|
||||||
|
|
Loading…
Reference in New Issue