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();
|
||||
try {
|
||||
grok.compile(input);
|
||||
} catch (GrokException e) {
|
||||
} catch (GrokException | java.util.regex.PatternSyntaxException e) {
|
||||
return new ValidationResult.Builder()
|
||||
.subject(subject)
|
||||
.input(input)
|
||||
.valid(false)
|
||||
.explanation("Not a valid Grok Expression")
|
||||
.build();
|
||||
} catch (java.util.regex.PatternSyntaxException e) {
|
||||
return new ValidationResult.Builder()
|
||||
.subject(subject)
|
||||
.input(input)
|
||||
.valid(false)
|
||||
.explanation("Not a valid Grok Expression")
|
||||
.explanation("Not a valid Grok Expression - " + e.getMessage())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue