Skip to content

Commit 7b5815e

Browse files
authored
Show import error when faiing to load an extension (#878)
import error may not be on the top-level module, it could deeper, e.g. during load
1 parent d901415 commit 7b5815e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jupyter_server/extension/manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ def _validate_name(self, proposed):
175175
self._extension_points = {}
176176
try:
177177
self._module, self._metadata = get_metadata(name)
178-
except ImportError:
178+
except ImportError as e:
179179
raise ExtensionModuleNotFound(
180-
"The module '{name}' could not be found. Are you "
181-
"sure the extension is installed?".format(name=name)
180+
"The module '{name}' could not be found ({e}). Are you "
181+
"sure the extension is installed?".format(name=name, e=e)
182182
)
183183
# Create extension point interfaces for each extension path.
184184
for m in self._metadata:

0 commit comments

Comments
 (0)