Skip to content

Commit

Permalink
add a more explicit error messag when reading the config
Browse files Browse the repository at this point in the history
Signed-off-by: John Crispin <john@phrozen.org>
  • Loading branch information
blogic committed Nov 11, 2021
1 parent 5c3c572 commit 2d88a87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion generate-reader.uc
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,10 @@ let GeneratorProto = {
}

this.print(indent, 'if (success %s) {', variantErrorCond);
this.print(indent, ' push(errors, [ location, "must match %s of the following constraints:\\n" + join("\\n- or -\\n", verrors) ]);', variantErrorMsg);
this.print(indent, ' if (length(verrors))');
this.print(indent, ' push(errors, [ location, "must match %s of the following constraints:\\n" + join("\\n- or -\\n", verrors) ]);', variantErrorMsg);
this.print(indent, ' else');
this.print(indent, ' push(errors, [ location, "must match only one variant" ]);');
this.print(indent, ' return null;');
this.print(indent, '}\n');
this.print(indent, 'value = vvalue;\n');
Expand Down

0 comments on commit 2d88a87

Please sign in to comment.