Skip to content

Commit

Permalink
Increased robustness if query module can't be imported
Browse files Browse the repository at this point in the history
  • Loading branch information
vthorsteinsson committed Jul 18, 2024
1 parent 26bb4ef commit b8cc085
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions queries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b8cc085

Please sign in to comment.