From 1372d58ad46d5f5ee802b42c4af1222a76d1e5fc Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 3 Dec 2020 12:54:03 +1100 Subject: [PATCH] improve error messages when rendering bundles that are documents that aren't properly formed --- .../src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java index 591b49d4f..9d1a1f820 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java @@ -63,7 +63,7 @@ public class BundleRenderer extends ResourceRenderer { List entries = b.children("entry"); if ("document".equals(b.get("type").primitiveValue())) { 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); } else if ("collection".equals(b.get("type").primitiveValue()) && allEntriesAreHistoryProvenance(entries)) { // nothing