diff --git a/src/main/java/org/veupathdb/service/eda/common/model/EntityDef.java b/src/main/java/org/veupathdb/service/eda/common/model/EntityDef.java index 871d18e0..38d60024 100644 --- a/src/main/java/org/veupathdb/service/eda/common/model/EntityDef.java +++ b/src/main/java/org/veupathdb/service/eda/common/model/EntityDef.java @@ -158,7 +158,7 @@ public String toString() { } public void addVariable(VariableDef variable) { - addIfUnique(_categories, EntityChildUniquenessKey::fromVar, variable); + addIfUnique(_variables, EntityChildUniquenessKey::fromVar, variable); } public void addCategory(VariableDef category) { diff --git a/src/main/java/org/veupathdb/service/eda/common/plugin/util/PluginUtil.java b/src/main/java/org/veupathdb/service/eda/common/plugin/util/PluginUtil.java index 7e5b93ed..f58e91c5 100644 --- a/src/main/java/org/veupathdb/service/eda/common/plugin/util/PluginUtil.java +++ b/src/main/java/org/veupathdb/service/eda/common/plugin/util/PluginUtil.java @@ -63,7 +63,9 @@ private String getCollectionAttribute(Function getter, Collect } private String getVariableAttribute(Function getter, VariableSpec var) { - return var == null ? "" : getter.apply(_metadata.getVariable(var).orElseThrow()).toString(); + return var == null ? "" : getter.apply(_metadata.getVariable(var) + .orElseThrow(() -> new IllegalArgumentException( + String.format("Unable to find variable with spec %s, %s", var.getEntityId(), var.getVariableId())))).toString(); } public String getCollectionType(CollectionSpec collection) {