Skip to content

Apply @handle_errors decorator to all handler modules (GH#200)#259

Merged
glebis merged 1 commit intomainfrom
feature/200-handle-errors-decorator
Feb 20, 2026
Merged

Apply @handle_errors decorator to all handler modules (GH#200)#259
glebis merged 1 commit intomainfrom
feature/200-handle-errors-decorator

Conversation

@glebis
Copy link
Copy Markdown
Owner

@glebis glebis commented Feb 20, 2026

Summary

  • Applied @handle_errors decorator to all 22 handler modules (~70 handler functions)
  • Each handler now gets: error classification, structured logging (chat_id/user_id), error counter integration, user-friendly error messages
  • Added AST-based coverage test (test_handle_errors_coverage.py) that ensures no future handler goes undecorated
  • Health endpoint already exposes error_counts from the ErrorCounter singleton

Test plan

  • 23/23 decorator coverage tests pass (parametrized per handler module)
  • 736/736 bot + observability tests pass (no regressions)
  • Deploy and verify error counter increments on real exceptions via /api/health

Closes: telegram_agent-shn

🤖 Generated with Claude Code

Standardize error reporting across all bot handlers by applying the
existing @handle_errors decorator to every public handler function.
This ensures consistent error classification, structured logging with
chat_id/user_id context, error counter integration, and user-friendly
error messages via Telegram.

- 22 handler modules updated with import + decorator
- ~70 handler functions now wrapped with @handle_errors
- AST-based coverage test ensures no future handler goes undecorated
- Health endpoint already exposes error counts from ErrorCounter

Closes: telegram_agent-shn

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@glebis glebis force-pushed the feature/200-handle-errors-decorator branch from 81bc2e2 to 2c89334 Compare February 20, 2026 10:37
@glebis glebis merged commit 97104ee into main Feb 20, 2026
5 checks passed
@glebis glebis deleted the feature/200-handle-errors-decorator branch February 20, 2026 10:41
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.

1 participant