Skip to content

feat: add ExceptionNotifier to notify crew about exceptions - #43

Merged
j4n merged 3 commits into
mainfrom
j4n/exception-notifier
Jul 29, 2026
Merged

j4n merged 3 commits into
mainfrom
j4n/exception-notifier

Conversation

@j4n

@j4n j4n commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes Issue #42: team-bot hook exceptions are silent to the team. The deltachat-rpc-client event loop already catches hook exceptions and logs them to the journal. Here, we add a decorator that catches the exceptions and forwards them to the crew chat. Tries to avoid flooding with a simple cooldown timer (5 min by default). The exception is sent as an HTML message with a one-line summary and a pre-wrapped traceback. The decorator sits below @relayhooks.on(...) on each hook so the hook collection registers the wrapper, not the bare function. Add tests for html format and an end-to-end test.

@j4n
j4n requested a review from missytake July 27, 2026 13:32
@j4n
j4n force-pushed the j4n/exception-notifier branch 2 times, most recently from e33c68a to 2e3c530 Compare July 27, 2026 13:47
@j4n

j4n commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Also lowered required Python to 3.10; and maybe uv.lock shouldn't be in the repo?

@j4n
j4n force-pushed the j4n/exception-notifier branch 3 times, most recently from 8492bfa to 29f4419 Compare July 28, 2026 09:42

@missytake missytake left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! the details in the html is a nice touch. 3 minor comments:

Comment thread tests/test_bot.py Outdated
Comment thread pyproject.toml
Comment thread src/team_bot/exception_notifier.py Outdated
@j4n
j4n force-pushed the j4n/exception-notifier branch from 29f4419 to ee4250d Compare July 29, 2026 16:45
j4n added 3 commits July 29, 2026 20:06
3.11 does not seem to be needed, drop required Python version to 3.10
and add to the test matrix, amend pyproject.toml to make argparse happy.
Closes Issue #42: "team-bot hook exceptions are silent to the team"
The deltachat-rpc-client event loop already catches hook exceptions and
logs them to the journal. Here, we add a decorator that catches the
exceptions and forwards them to the crew chat. Tries to avoid flooding
with a simple cooldown timer (1h by default). The exception is sent
as an HTML message with a one-line summary and a <pre>-wrapped
traceback. The decorator sits below @relayhooks.on() to register the
wrapper. Add tests for html format and an end-to-end test.
uv.lock churns on every dependency resolution and merges poorly
between contributors on different platforms/python versions; drop it
from version control and ignore it going forward.
@j4n
j4n force-pushed the j4n/exception-notifier branch from ee4250d to 79e8fb9 Compare July 29, 2026 18:08
@j4n
j4n merged commit c0fdf13 into main Jul 29, 2026
3 checks passed
@j4n
j4n deleted the j4n/exception-notifier branch July 29, 2026 18:30
@j4n j4n mentioned this pull request Jul 29, 2026
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.

2 participants