Skip to content

Commit d66a720

Browse files
committed
Better error reporting when missing slot names (closes #240)
1 parent 7d1d503 commit d66a720

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/main/java/edu/harvard/iq/policymodels/cli/commands/LocalizationDiffCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public String command() {
3838

3939
@Override
4040
public String description() {
41-
return "Prints the differences between a localization and the model (e.g. non-licalized nodes).";
41+
return "Prints the differences between a localization and the model (e.g. non-localized nodes).";
4242
}
4343

4444
@Override

src/main/java/edu/harvard/iq/policymodels/parser/decisiongraph/CompilationUnit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private AbstractSlot findSlot(List<String> astSlot, CompoundValue topValue, SetN
196196
final CompoundValue additionPoint = valueBuilder.descend(C.tail(fullyQualifiedSlotName.get(astSlot)), topValue);
197197
slot = additionPoint.getSlot().getSubSlot(C.last(astSlot));
198198
} catch (RuntimeException re) {
199-
throw new RuntimeException("Tag not found");
199+
throw new RuntimeException("Slot " + astSlot.toString() + " not found");
200200
}
201201
}
202202
return slot;

src/main/java/edu/harvard/iq/policymodels/parser/decisiongraph/SetNodeValueBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public void visit(AstSetNode.AggregateAssignment aa) {
8585
valueType.accept(new AbstractSlot.VoidVisitor() {
8686
@Override
8787
public void visitAtomicSlotImpl(AtomicSlot t) {
88-
throw new RuntimeException("Slot " + aa.getSlot() + " is atomic, not aggregate. Can't assign values here.");
88+
throw new RuntimeException("Slot " + aa.getSlot() + " is atomic, not aggregate. Can't add values "
89+
+ "("+ aa.getSlot().get(0) + "+=value), only assign them ("+ aa.getSlot().get(0) +"=value)");
8990
}
9091

9192
@Override

0 commit comments

Comments
 (0)