Skip to content

Commit 4e73b3e

Browse files
committed
refactor: Log a debug message when inspecting a module raises an error
Issue-mkdocstrings-753: mkdocstrings/mkdocstrings#753
1 parent 95cdd8c commit 4e73b3e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/_griffe/loader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,8 @@ def _inspect_module(self, module_name: str, filepath: Path | None = None, parent
667667
)
668668
except SystemExit as error:
669669
raise ImportError(f"Importing '{module_name}' raised a system exit") from error
670+
except Exception as error:
671+
raise ImportError(f"Importing '{module_name}' raised an exception") from error
670672
elapsed = datetime.now(tz=timezone.utc) - start
671673
self._time_stats["time_spent_inspecting"] += elapsed.microseconds
672674
return module

0 commit comments

Comments
 (0)