Remove redundant exception classes and fix existing ones

Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
lzzy12 2020-03-27 14:35:51 +05:30
parent 6d07c3c8c4
commit 0de6915222
2 changed files with 2 additions and 23 deletions

View File

@ -1,23 +1,2 @@
class DriveAuthError(Exception):
pass
class MessageDeletedError(Exception):
""" Custom Exception class for killing thread as soon as they aren't needed"""
def __init__(self, message, error=None):
super().__init__(message)
self.error = error
class DownloadCancelled(Exception):
def __init__(self, message, error=None):
super().__init__(message)
self.error = error
class DirectDownloadLinkException(Exception):
def __init__(self, message, error=None):
super().__init__(message)
self.error = error
pass

View File

@ -173,7 +173,7 @@ def _mirror(bot, update, isTar=False):
try:
link = direct_link_generator(link)
except DirectDownloadLinkException as e:
LOGGER.info(f'{link}: {e.error}')
LOGGER.info(f'{link}: {e}')
listener = MirrorListener(bot, update, isTar, tag)
aria = aria2_download.AriaDownloadHelper(listener)
aria.add_download(link, f'{DOWNLOAD_DIR}/{listener.uid}/')