Skip to content

Commit

Permalink
Improve error message on regex()
Browse files Browse the repository at this point in the history
  • Loading branch information
Edmundo Alvarez committed Jul 20, 2016
1 parent 32d18fa commit ca8d894
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public RegexMatchResult evaluate(FunctionArgs args, EvaluationContext context) {
final Pattern regex = pattern.required(args, context);
final String value = this.value.required(args, context);
if (regex == null || value == null) {
throw new IllegalArgumentException();
final String nullArgument = regex == null ? "pattern" : "value";
throw new IllegalArgumentException("Argument '" + nullArgument + "' cannot be 'null'");
}
//noinspection unchecked
final List<String> groupNames =
Expand Down

0 comments on commit ca8d894

Please sign in to comment.