Prevent crashing on exeptions during reload of extensions

This commit is contained in:
clerie 2023-06-18 15:28:53 +02:00
parent e51cf2fc48
commit ca9c82dd59

View File

@ -91,4 +91,9 @@ class FieldPOC:
self.config = config.Config(json.loads(self.config_file_path.read_text()))
def _load_extensions(self):
self.extensions = extensions.Extensions(json.loads(pathlib.Path(self.config.extensions.file).read_text()))
try:
new_extensions = extensions.Extensions(json.loads(pathlib.Path(self.config.extensions.file).read_text()))
except:
logger.exception("loading extensions failed")
else:
self.extensions = new_extensions