UI - Improve error handling when a module is missing when editing a URL/link

2673-plugin-missing-url-check
dgtlmoon 3 months ago
parent 5b34aece96
commit d40a11735b

@ -1,5 +1,6 @@
import os import os
import re import re
from loguru import logger
from changedetectionio.strtobool import strtobool from changedetectionio.strtobool import strtobool
@ -525,9 +526,16 @@ class processor_text_json_diff_form(commonSettingsForm):
try: try:
from changedetectionio.safe_jinja import render as jinja_render from changedetectionio.safe_jinja import render as jinja_render
jinja_render(template_str=self.url.data) 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: except Exception as e:
logger.error(e)
self.url.errors.append('Invalid template syntax') self.url.errors.append('Invalid template syntax')
result = False result = False
return result return result
class SingleExtraProxy(Form): class SingleExtraProxy(Form):

Loading…
Cancel
Save