Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handing broken extensions #303

Merged
merged 2 commits into from
Sep 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions jupyter_server/extension/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,17 @@ def from_jpserver_extensions(self, jpserver_extensions):
self.add_extension(name, enabled=enabled)

def add_extension(self, extension_name, enabled=False):
"""Try to add extension to manager, return True is successful.
Zsailer marked this conversation as resolved.
Show resolved Hide resolved
Otherwise, return False.
"""
try:
extpkg = ExtensionPackage(name=extension_name, enabled=enabled)
self._extensions[extension_name] = extpkg
return True
# Raise a warning if the extension cannot be loaded.
except Exception as e:
self.log.warning(e)
return False

def link_extension(self, name, serverapp):
linked = self._linked_extensions.get(name, False)
Expand Down