Major Domo v2 - Discord bot for Strat-o-Matic Baseball Association
Added defensive error handling to prevent crashes when custom command creators are missing from the database. Changes Made: 1. services/custom_commands_service.py: - Added try/except blocks in get_popular_commands() - Added try/except blocks in get_commands_needing_warning() - Added try/except blocks in get_commands_eligible_for_deletion() - Catches BotException when get_creator_by_id() fails - Logs warning with command details and continues processing - Skips problematic commands instead of failing entire operation 2. commands/help/main.py: - Removed redundant emoji from success message title - EmbedTemplate.success() already includes check mark emoji 3. tests/test_models_help_command.py: - Updated test assertions to match new message format 4. tests/test_services_help_commands.py: - Updated test expectations for error handling behavior Impact: - Prevents service crashes when creator data is orphaned or deleted - Maintains functionality for commands with valid creator data - Provides visibility into data integrity issues via warning logs - Ensures automated cleanup tasks can complete successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| api | ||
| commands | ||
| models | ||
| services | ||
| tasks | ||
| tests | ||
| utils | ||
| views | ||
| .gitignore | ||
| bot.py | ||
| config.py | ||
| constants.py | ||
| exceptions.py | ||
| PRE_LAUNCH_ROADMAP.md | ||
| requirements.txt | ||
| test_real_data.py | ||