Remove redundant exception classes and fix existing ones
Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
parent
6d07c3c8c4
commit
0de6915222
|
|
@ -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):
|
class DirectDownloadLinkException(Exception):
|
||||||
def __init__(self, message, error=None):
|
pass
|
||||||
super().__init__(message)
|
|
||||||
self.error = error
|
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ def _mirror(bot, update, isTar=False):
|
||||||
try:
|
try:
|
||||||
link = direct_link_generator(link)
|
link = direct_link_generator(link)
|
||||||
except DirectDownloadLinkException as e:
|
except DirectDownloadLinkException as e:
|
||||||
LOGGER.info(f'{link}: {e.error}')
|
LOGGER.info(f'{link}: {e}')
|
||||||
listener = MirrorListener(bot, update, isTar, tag)
|
listener = MirrorListener(bot, update, isTar, tag)
|
||||||
aria = aria2_download.AriaDownloadHelper(listener)
|
aria = aria2_download.AriaDownloadHelper(listener)
|
||||||
aria.add_download(link, f'{DOWNLOAD_DIR}/{listener.uid}/')
|
aria.add_download(link, f'{DOWNLOAD_DIR}/{listener.uid}/')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue