better error reporting when parsing fails outright

This commit is contained in:
Grahame Grieve 2023-06-01 06:58:46 +03:00
parent d4d5b42aa1
commit c31836e734
1 changed files with 1 additions and 1 deletions

View File

@ -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");