mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 02:41:06 -05:00
Exception Handling:
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
This commit is contained in:
@@ -5,7 +5,7 @@ import discord
|
|||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import asyncio
|
import asyncio
|
||||||
from .exceptions import ConfigError, DiscordAPIError
|
from .utils.exceptions import ConfigurationError as ConfigError, DiscordAPIError
|
||||||
|
|
||||||
logger = logging.getLogger('VideoArchiver')
|
logger = logging.getLogger('VideoArchiver')
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from .utils.exceptions import (
|
|||||||
VideoVerificationError,
|
VideoVerificationError,
|
||||||
QueueError,
|
QueueError,
|
||||||
FileCleanupError,
|
FileCleanupError,
|
||||||
|
DiscordAPIError,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Re-export base exceptions
|
# Re-export base exceptions
|
||||||
@@ -18,6 +19,7 @@ __all__ = [
|
|||||||
'UpdateError',
|
'UpdateError',
|
||||||
'ProcessingError',
|
'ProcessingError',
|
||||||
'ConfigError',
|
'ConfigError',
|
||||||
|
'DiscordAPIError',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Alias exceptions for backward compatibility
|
# Alias exceptions for backward compatibility
|
||||||
|
|||||||
@@ -51,3 +51,9 @@ class QueueError(VideoArchiverError):
|
|||||||
class ComponentError(VideoArchiverError):
|
class ComponentError(VideoArchiverError):
|
||||||
"""Error with component initialization or cleanup"""
|
"""Error with component initialization or cleanup"""
|
||||||
pass
|
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'})")
|
||||||
|
|||||||
Reference in New Issue
Block a user