improve error message

This commit is contained in:
Grahame Grieve 2023-03-11 18:53:29 +11:00
parent 6833ddd110
commit 939d1d06c0
1 changed files with 2 additions and 2 deletions

View File

@ -426,9 +426,9 @@ public abstract class Element extends Base implements IBaseHasExtensions, IBaseE
if (ext.isEmpty())
return null;
if (ext.size() > 1)
throw new FHIRException("Multiple matching extensions found");
throw new FHIRException("Multiple matching extensions found for extension '"+theUrl+"'");
if (!ext.get(0).getValue().isPrimitive())
throw new FHIRException("Extension could not be converted to a string");
throw new FHIRException("Extension '"+theUrl+"' could not be converted to a string");
return ext.get(0).getValue().primitiveValue();
}