-
Notifications
You must be signed in to change notification settings - Fork 324
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
Check plugin activation error #432
Conversation
@@ -48,15 +50,28 @@ def __init__(self, plugin_path: str, active: bool): | |||
|
|||
# all plugins start active, they can be deactivated/reactivated from endpoint | |||
if active: | |||
self.activate() | |||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary? Having already a try/except in the /plugins/toggle/
endpoint and inside self._load_hooks_and_tools
?
for py_file in self.py_files: | ||
py_filename = py_file.replace("/", ".").replace(".py", "") # this is UGLY I know. I'm sorry | ||
log(f"Remove module {py_filename}", "DEBUG") | ||
sys.modules.pop(py_filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
@Pingdred I'm having difficulties undesrstanding where the try/except blocks are necessary and where they are not. |
Sure, I'll ping you on discord later 😄 |
Thanks <3 |
Description
Check if there is an error activating the plugin and if so, return HTTP 500.
Also plugin modules are "unimported" when it is disabled.
Type of change
Checklist: