""" Custom Exception Classes Defines application-specific exceptions for better error handling and clearer error messages throughout the codebase. """ class PterodisBotError(Exception): """Base exception class for all PterodisBot errors.""" pass class ConfigValidationError(PterodisBotError): """ Raised when configuration validation fails. Contains detailed error messages for all validation failures. """ pass class APIError(PterodisBotError): """ Raised when an API request fails. Attributes: endpoint: The API endpoint that failed status_code: HTTP status code if available message: Error message from the API """ def __init__( self, message: str, endpoint: str = "", status_code: int = 0, ) -> None: super().__init__(message) self.endpoint = endpoint self.status_code = status_code self.message = message class ServerNotFoundError(PterodisBotError): """ Raised when a requested server is not found in the panel. """ pass class PermissionError(PterodisBotError): """ Raised when a user lacks required permissions for an action. """ pass class EmbedNotFoundError(PterodisBotError): """ Raised when a tracked embed message is not found in Discord. """ pass class MetricsError(PterodisBotError): """ Raised when metrics graph generation fails. """ pass class ConfigurationError(PterodisBotError): """ Raised when there's a configuration issue not caught during startup validation. """ pass