From d40a11735b8d7db6c2287d7bd6ec0866ab37e53f Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sat, 5 Oct 2024 16:28:18 +0200 Subject: [PATCH] UI - Improve error handling when a module is missing when editing a URL/link --- changedetectionio/forms.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/changedetectionio/forms.py b/changedetectionio/forms.py index d3ac30fc..a8a6a97a 100644 --- a/changedetectionio/forms.py +++ b/changedetectionio/forms.py @@ -1,5 +1,6 @@ import os import re +from loguru import logger from changedetectionio.strtobool import strtobool @@ -525,9 +526,16 @@ class processor_text_json_diff_form(commonSettingsForm): try: from changedetectionio.safe_jinja import render as jinja_render jinja_render(template_str=self.url.data) + except ModuleNotFoundError as e: + # incase jinja2_time or others is missing + logger.error(e) + self.url.errors.append(e) + result = False except Exception as e: + logger.error(e) self.url.errors.append('Invalid template syntax') result = False + return result class SingleExtraProxy(Form):