mirror of https://github.com/apache/nifi.git
ExtractGrok - Include exception message when compile fails
This closes: #1845 Signed-off-by: Andre F de Miranda <trixpan@users.noreply.github.com>
This commit is contained in:
parent
3966f5ce86
commit
80dfe0257f
|
@ -255,19 +255,12 @@ public class ExtractGrok extends AbstractProcessor {
|
||||||
Grok grok = new Grok();
|
Grok grok = new Grok();
|
||||||
try {
|
try {
|
||||||
grok.compile(input);
|
grok.compile(input);
|
||||||
} catch (GrokException e) {
|
} catch (GrokException | java.util.regex.PatternSyntaxException e) {
|
||||||
return new ValidationResult.Builder()
|
return new ValidationResult.Builder()
|
||||||
.subject(subject)
|
.subject(subject)
|
||||||
.input(input)
|
.input(input)
|
||||||
.valid(false)
|
.valid(false)
|
||||||
.explanation("Not a valid Grok Expression")
|
.explanation("Not a valid Grok Expression - " + e.getMessage())
|
||||||
.build();
|
|
||||||
} catch (java.util.regex.PatternSyntaxException e) {
|
|
||||||
return new ValidationResult.Builder()
|
|
||||||
.subject(subject)
|
|
||||||
.input(input)
|
|
||||||
.valid(false)
|
|
||||||
.explanation("Not a valid Grok Expression")
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue