mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 02:41:06 -05:00
Added DiscordAPIError to utils/exceptions.py Fixed exception imports in config_manager.py Ensured consistent exception hierarchy Improved error messages and context URL Processing: Added pre-filtering for URLs before yt-dlp checks Added common video platform patterns Reduced error logging noise Improved URL validation efficiency FFmpeg Management: Enhanced FFmpeg binary verification Added robust subprocess handling Improved cleanup of failed operations Added detailed logging Configuration: Fixed ConfigurationError import Improved error handling in config operations Enhanced channel validation Better error propagation
60 lines
1.5 KiB
Python
60 lines
1.5 KiB
Python
"""Custom exceptions for VideoArchiver"""
|
|
|
|
class VideoArchiverError(Exception):
|
|
"""Base exception for VideoArchiver errors"""
|
|
pass
|
|
|
|
class VideoDownloadError(VideoArchiverError):
|
|
"""Error downloading video"""
|
|
pass
|
|
|
|
class VideoProcessingError(VideoArchiverError):
|
|
"""Error processing video"""
|
|
pass
|
|
|
|
class VideoVerificationError(VideoArchiverError):
|
|
"""Error verifying video"""
|
|
pass
|
|
|
|
class VideoUploadError(VideoArchiverError):
|
|
"""Error uploading video"""
|
|
pass
|
|
|
|
class VideoCleanupError(VideoArchiverError):
|
|
"""Error cleaning up video files"""
|
|
pass
|
|
|
|
class FileCleanupError(VideoArchiverError):
|
|
"""Error cleaning up files"""
|
|
pass
|
|
|
|
class ConfigurationError(VideoArchiverError):
|
|
"""Error in configuration"""
|
|
pass
|
|
|
|
class PermissionError(VideoArchiverError):
|
|
"""Error with file permissions"""
|
|
pass
|
|
|
|
class NetworkError(VideoArchiverError):
|
|
"""Error with network operations"""
|
|
pass
|
|
|
|
class ResourceError(VideoArchiverError):
|
|
"""Error with system resources"""
|
|
pass
|
|
|
|
class QueueError(VideoArchiverError):
|
|
"""Error with queue operations"""
|
|
pass
|
|
|
|
class ComponentError(VideoArchiverError):
|
|
"""Error with component initialization or cleanup"""
|
|
pass
|
|
|
|
class DiscordAPIError(VideoArchiverError):
|
|
"""Error with Discord API operations"""
|
|
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'})")
|