Unclear error message when missing brackets
clenk opened this issue · comments
Chris Lenk commented
If the input is missing the surrounding '[' and ']' (ie. the input is just a Comparison Expression, not an Observation Expression or Pattern Expresion), the validator's error message is unhelpful:
$ validate_patterns
Enter a pattern to validate: file-object:hashes.md5 = '79054025255fb1a26e4bc422aef54eb4'
FAIL: Error found at line 1:0. no viable alternative at input 'file-object'
This message comes from the ANTLR library so it can't easily be changed, but perhaps the validator could check if the input starts with '[' or '([' and print a more user-friendly error message?