Major Domo v2 - Discord bot for Strat-o-Matic Baseball Association
Go to file
Cal Corum 5acd378c72 CLAUDE: Add graceful error handling for missing creators in custom commands
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>
2025-10-13 17:53:58 -05:00
api CLAUDE: Fix /set-image command to use query parameters for API updates 2025-10-13 17:52:14 -05:00
commands CLAUDE: Add graceful error handling for missing creators in custom commands 2025-10-13 17:53:58 -05:00
models CLAUDE: Implement custom help commands system 2025-10-10 13:14:13 -05:00
services CLAUDE: Add graceful error handling for missing creators in custom commands 2025-10-13 17:53:58 -05:00
tasks CLAUDE: Comprehensive bot improvements and test infrastructure 2025-10-02 11:35:26 -05:00
tests CLAUDE: Add graceful error handling for missing creators in custom commands 2025-10-13 17:53:58 -05:00
utils CLAUDE: Fix trade system issues and enhance documentation 2025-10-06 16:10:13 -05:00
views CLAUDE: Implement custom help commands system 2025-10-10 13:14:13 -05:00
.gitignore CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
bot.py CLAUDE: Implement player image management system 2025-10-10 13:54:12 -05:00
config.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
constants.py CLAUDE: Implement custom help commands system 2025-10-10 13:14:13 -05:00
exceptions.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
PRE_LAUNCH_ROADMAP.md CLAUDE: Implement player image management system 2025-10-10 13:54:12 -05:00
requirements.txt CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
test_real_data.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00