Skip to content

Commit

Permalink
Descriptive error message for too many positional arguments for Actio…
Browse files Browse the repository at this point in the history
…nLang
  • Loading branch information
retrodaredevil committed Dec 13, 2024
1 parent b49393b commit a5b3033
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public JsonNode translate(Node node) {
List<Argument> positionalArguments = node.getPositionalArguments();
if (positionalArguments.size() > positionalArgumentFieldNames.size()) {
// We check for too many positional arguments and let whatever parses the JSON decide if there is too few arguments
throw new IllegalArgumentException("Too many positional arguments for type: " + typeName + ". Arguments: " + positionalArguments);
throw new IllegalArgumentException("Too many positional arguments for type: " + typeName + ". Arguments: " + positionalArguments + ". Expected a maximum of " + positionalArgumentFieldNames.size() + " positional arguments, but got " + positionalArguments.size());
}
for (int i = 0; i < positionalArguments.size(); i++) {
String fieldName = positionalArgumentFieldNames.get(i);
Expand Down

0 comments on commit a5b3033

Please sign in to comment.