Skip to content

Commit

Permalink
fix: continue to load other plugins when one python plugin is failed …
Browse files Browse the repository at this point in the history
…to load
  • Loading branch information
wu-vincent committed Jul 28, 2024
1 parent 2b477a3 commit 8f97fa3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/src/endstone/_internal/plugin_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ def load_plugins(self, directory) -> List[Plugin]:
continue

# get distribution metadata
plugin_metadata = metadata(ep.dist.name).json

# load module
cls = ep.load()
try:
plugin_metadata = metadata(ep.dist.name).json
cls = ep.load()
except Exception as e:
self.server.logger.error(f"Error occurred when trying to load plugin from entry point '{ep.name}': {e}")
continue

# prepare plugin description
cls_attr = dict(cls.__dict__)
Expand Down

0 comments on commit 8f97fa3

Please sign in to comment.