diff --git a/videoarchiver/exceptions.py b/videoarchiver/exceptions.py index 9a44787..9adda22 100644 --- a/videoarchiver/exceptions.py +++ b/videoarchiver/exceptions.py @@ -6,23 +6,43 @@ from .utils.exceptions import ( VideoVerificationError, QueueError, FileCleanupError, + ResourceExhaustedError, + ProcessingError, + CleanupError, + FileOperationError, + VideoDownloadError, + VideoProcessingError, + VideoUploadError, + VideoCleanupError, + PermissionError, + NetworkError, + ResourceError, + ComponentError, DiscordAPIError, ) -# Re-export base exceptions +# Re-export all exceptions __all__ = [ 'VideoArchiverError', 'ConfigurationError', 'VideoVerificationError', 'QueueError', 'FileCleanupError', - 'UpdateError', + 'ResourceExhaustedError', 'ProcessingError', - 'ConfigError', + 'CleanupError', + 'FileOperationError', + 'VideoDownloadError', + 'VideoProcessingError', + 'VideoUploadError', + 'VideoCleanupError', + 'PermissionError', + 'NetworkError', + 'ResourceError', + 'ComponentError', 'DiscordAPIError', ] # Alias exceptions for backward compatibility -ProcessingError = VideoArchiverError ConfigError = ConfigurationError UpdateError = VideoVerificationError diff --git a/videoarchiver/utils/exceptions.py b/videoarchiver/utils/exceptions.py index 0a50c36..0e2e24a 100644 --- a/videoarchiver/utils/exceptions.py +++ b/videoarchiver/utils/exceptions.py @@ -57,3 +57,21 @@ class DiscordAPIError(VideoArchiverError): def __init__(self, message: str, status_code: int = None): self.status_code = status_code super().__init__(f"Discord API Error: {message} (Status: {status_code if status_code else 'Unknown'})") + +class ResourceExhaustedError(VideoArchiverError): + """Error when system resources are exhausted""" + def __init__(self, message: str, resource_type: str = None): + self.resource_type = resource_type + super().__init__(f"Resource exhausted: {message} (Type: {resource_type if resource_type else 'Unknown'})") + +class ProcessingError(VideoArchiverError): + """Error during video processing""" + pass + +class CleanupError(VideoArchiverError): + """Error during cleanup operations""" + pass + +class FileOperationError(VideoArchiverError): + """Error during file operations""" + pass