Skip to content

Commit

Permalink
Include event handler name in error message (#15471)
Browse files Browse the repository at this point in the history
We currently don't log the name of the event handler being called when the callback fails.
This commit prepends the name assigned to it so that we can have better chances of
fixing bugs.
  • Loading branch information
anodos325 authored Jan 23, 2025
1 parent b01abf8 commit 03d7282
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middlewared/middlewared/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ async def wrap(handler):
try:
await handler(self, event_type, kwargs)
except Exception:
self.logger.error('Unhandled exception in event handler', exc_info=True)
self.logger.error('%s: Unhandled exception in event handler', name, exc_info=True)

# Send event also for internally subscribed plugins
for handler in self.__event_subs.get(name, []):
Expand Down

0 comments on commit 03d7282

Please sign in to comment.