Skip to content
This repository was archived by the owner on Mar 21, 2023. It is now read-only.

Commit ca8d894

Browse files
author
Edmundo Alvarez
committed
Improve error message on regex()
1 parent 32d18fa commit ca8d894

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/org/graylog/plugins/pipelineprocessor/functions/strings

1 file changed

+2
-1
lines changed

src/main/java/org/graylog/plugins/pipelineprocessor/functions/strings/RegexMatch.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public RegexMatchResult evaluate(FunctionArgs args, EvaluationContext context) {
5252
final Pattern regex = pattern.required(args, context);
5353
final String value = this.value.required(args, context);
5454
if (regex == null || value == null) {
55-
throw new IllegalArgumentException();
55+
final String nullArgument = regex == null ? "pattern" : "value";
56+
throw new IllegalArgumentException("Argument '" + nullArgument + "' cannot be 'null'");
5657
}
5758
//noinspection unchecked
5859
final List<String> groupNames =

0 commit comments

Comments
 (0)