From ca9c82dd597c429aa8ef75cc33aa07021a4ac0ba Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 18 Jun 2023 15:28:53 +0200 Subject: [PATCH] Prevent crashing on exeptions during reload of extensions --- fieldpoc/fieldpoc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fieldpoc/fieldpoc.py b/fieldpoc/fieldpoc.py index 02e3381..44ad259 100644 --- a/fieldpoc/fieldpoc.py +++ b/fieldpoc/fieldpoc.py @@ -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