Fixed Exception Structure:

Added FileCleanupError to utils/exceptions.py
Created root exceptions.py for better organization
Fixed circular imports in utils/init.py
Updated imports in video_archiver.py and update_checker.py
Fixed FFmpeg Management:

Updated extraction logic for BtbN's new archive structure
Added fallback for backward compatibility
Better binary verification and permissions handling
Improved Error Handling:

Proper exception hierarchy
Better error propagation
More detailed error messages
Enhanced cleanup on errors
This commit is contained in:
pacnpal
2024-11-15 04:34:35 +00:00
parent 767f1140d1
commit e4429a9d9e
5 changed files with 116 additions and 135 deletions

View File

@@ -3,9 +3,11 @@
from .exceptions import FileCleanupError, VideoVerificationError
from .file_ops import secure_delete_file, cleanup_downloads
from .path_manager import temp_path_context
from .video_downloader import VideoDownloader
from .message_manager import MessageManager
# Import VideoDownloader last to avoid circular imports
from .video_downloader import VideoDownloader
__all__ = [
'FileCleanupError',
'VideoVerificationError',

View File

@@ -17,11 +17,12 @@ from videoarchiver.ffmpeg.ffmpeg_manager import FFmpegManager
from videoarchiver.ffmpeg.exceptions import (
FFmpegError,
CompressionError,
VideoVerificationError,
VerificationError,
FFprobeError,
TimeoutError,
handle_ffmpeg_error
)
from videoarchiver.utils.exceptions import VideoVerificationError
from videoarchiver.utils.file_ops import secure_delete_file
from videoarchiver.utils.path_manager import temp_path_context