From 56d1dde7c3c56feb229804796b47e959b80355db Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 26 Oct 2021 22:30:58 +0200 Subject: [PATCH] Re #265 - wasnt catching the jsonpath exception due to invalid jsonpath expressions properly --- changedetectionio/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changedetectionio/forms.py b/changedetectionio/forms.py index af675524..7f0be2e8 100644 --- a/changedetectionio/forms.py +++ b/changedetectionio/forms.py @@ -178,14 +178,14 @@ class ValidateCSSJSONInput(object): def __call__(self, form, field): if 'json:' in field.data: - from jsonpath_ng.exceptions import JsonPathParserError + from jsonpath_ng.exceptions import JsonPathParserError, JsonPathLexerError from jsonpath_ng import jsonpath, parse input = field.data.replace('json:', '') try: parse(input) - except JsonPathParserError as e: + except (JsonPathParserError, JsonPathLexerError) as e: message = field.gettext('\'%s\' is not a valid JSONPath expression. (%s)') raise ValidationError(message % (input, str(e)))