major-domo-v2/exceptions.py
Cal Corum 2409c27c1d CLAUDE: Add comprehensive scorecard submission system
Implements full Google Sheets scorecard submission with:
- Complete game data extraction (68 play fields, pitching decisions, box score)
- Transaction rollback support at 3 states (plays/game/complete)
- Duplicate game detection with confirmation dialog
- Permission-based submission (GMs only)
- Automated results posting to news channel
- Automatic standings recalculation
- Key plays display with WPA sorting

New Components:
- Play, Decision, Game models with full validation
- SheetsService for Google Sheets integration
- GameService, PlayService, DecisionService for data management
- ConfirmationView for user confirmations
- Discord helper utilities for channel operations

Services Enhanced:
- StandingsService: Added recalculate_standings() method
- CustomCommandsService: Fixed creator endpoint path
- Team/Player models: Added helper methods for display

Configuration:
- Added SHEETS_CREDENTIALS_PATH environment variable
- Added SBA_NETWORK_NEWS_CHANNEL and role constants
- Enabled pygsheets dependency

Documentation:
- Comprehensive README updates across all modules
- Added command, service, model, and view documentation
- Detailed workflow and error handling documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 00:21:32 -05:00

46 lines
1007 B
Python

"""
Custom exceptions for Discord Bot v2.0
Uses modern error handling patterns with discord.py's built-in error handling.
No decorators - rely on global error handlers and explicit try/catch blocks.
"""
class BotException(Exception):
"""Base exception for all bot-related errors."""
pass
class APIException(BotException):
"""Exception for API-related errors."""
pass
class PlayerNotFoundError(BotException):
"""Raised when a requested player cannot be found."""
pass
class TeamNotFoundError(BotException):
"""Raised when a requested team cannot be found."""
pass
class DraftException(BotException):
"""Exception for draft-related errors."""
pass
class ValidationException(BotException):
"""Exception for data validation errors."""
pass
class ConfigurationException(BotException):
"""Exception for configuration-related errors."""
pass
class SheetsException(BotException):
"""Exception for Google Sheets-related errors."""
pass