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

Be more careful about handling TypeError from plugin hook method calls #1086

Merged

Conversation

dairiki
Copy link
Contributor

@dairiki dairiki commented Nov 5, 2022

PluginController.emit, under certain circumstances, will silently ignore TypeErrors raised by plugin hook methods.

This fixes that.

In addition, each call to emit will now call each hook method at most once. Previously, under some circumstances, a hook method could be called twice during a single call to emit — that could possibly have unintended and confusing consequences for hooks that mutate plugin state.

Issue(s) Resolved

Fixes #1085

Description of Changes

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)

@dairiki dairiki changed the title Fix #1085 Be more careful about handling TypeError from plugin hook method calls Nov 5, 2022
@dairiki dairiki merged commit 6adae70 into lektor:master Nov 5, 2022
@dairiki dairiki deleted the bug.1085-pluginsystem_emit_ignores_typeerror branch November 5, 2022 19:47
dairiki added a commit to dairiki/lektor that referenced this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeErrors raised by plugin hooks are sometimes silently ignored
1 participant