"""APCloudy specific exceptions"""
[docs]
class APCloudyException(Exception):
"""Base exception for APCloudy operations"""
pass
[docs]
class APIError(APCloudyException):
"""Raised when API returns an error response"""
[docs]
def __init__(self, message: str, status_code: int = None, response_data: dict = None):
super().__init__(message)
self.status_code = status_code
self.response_data = response_data or {}
[docs]
class AuthenticationError(APIError):
"""Raised when authentication fails"""
pass
[docs]
class JobNotFoundError(APIError):
"""Raised when a job is not found"""
pass
[docs]
class ProjectNotFoundError(APIError):
"""Raised when a project is not found"""
pass
[docs]
class SpiderNotFoundError(APIError):
"""Raised when a spider is not found"""
pass
[docs]
class RateLimitError(APIError):
"""Raised when rate limit is exceeded"""
pass