From c31836e73444a3f4bad496cb47e24fc88fc372f9 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 1 Jun 2023 06:58:46 +0300 Subject: [PATCH] better error reporting when parsing fails outright --- .../src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java index 5c27a16f4..4f9db4d3b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java @@ -129,7 +129,7 @@ public abstract class ParserBase { if (res == null) { throw new FHIRException("Parsing FHIR content failed: "+errors.get(0).summary()); } else if (res.size() == 0) { - throw new FHIRException("Parsing FHIR content returned no elements in a context where one element is required"); + throw new FHIRException("Parsing FHIR content returned no elements in a context where one element is required because: "+errors.get(0).summary()); } if (res.size() != 1) { throw new FHIRException("Parsing FHIR content returned multiple elements in a context where only one element is allowed");