From b8cc085a11adecdd3f0f7146544b1cc4b77a2d41 Mon Sep 17 00:00:00 2001 From: Vilhjalmur Thorsteinsson Date: Thu, 18 Jul 2024 14:58:36 +0000 Subject: [PATCH] Increased robustness if query module can't be imported --- queries/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/queries/__init__.py b/queries/__init__.py index 7e182966..1d72541c 100755 --- a/queries/__init__.py +++ b/queries/__init__.py @@ -456,7 +456,9 @@ def init_class(cls) -> None: if is_proc: all_procs.append(m) except ImportError as e: - logging.error(f"Error importing query processor module {modname}: {e}") + logging.error(f"Error importing query processor module {modname}: {repr(e)}") + except Exception as e: + logging.error(f"Error initializing query processor module {modname}: {repr(e)}") # Sort the processors by descending priority # so that the higher-priority ones get invoked bfore the lower-priority ones @@ -518,7 +520,9 @@ def init_class(cls) -> None: ) ) except ImportError as e: - logging.error(f"Error importing utility module {modname}: {e}") + logging.error(f"Error importing utility module {modname}: {repr(e)}") + except Exception as e: + logging.error(f"Error initializing utility module {modname}: {repr(e)}") for processor in cls._tree_processors: # Check whether this tree processor supplies a query grammar fragment