From def54aca87da472f639fd7dd89a4835a040b2dfb Mon Sep 17 00:00:00 2001 From: lzzy12 Date: Sat, 28 Sep 2019 22:29:39 +0530 Subject: [PATCH] Mention error in the message while informing the user about cancellation Signed-off-by: lzzy12 --- bot/mirror.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/mirror.py b/bot/mirror.py index aa3dbd7..3d6ac72 100644 --- a/bot/mirror.py +++ b/bot/mirror.py @@ -8,6 +8,7 @@ from bot.helper.message_utils import * from bot.helper.bot_utils import get_readable_message, KillThreadException from bot.helper.download_status import DownloadStatus + class MirrorListener(listeners.MirrorListeners): def __init__(self, context, update, reply_message): super().__init__(context, update, reply_message) @@ -32,7 +33,8 @@ class MirrorListener(listeners.MirrorListeners): def onDownloadError(self, error, progress_status_list: list, index: int): LOGGER.error(error) - msg = "@{} your download has been cancelled!".format(self.message.from_user.username) + + msg = "@{} your download has been cancelled due to: {}".format(self.message.from_user.username, error) sendMessage(msg, self.context, self.update) del download_dict[self.message.message_id] fs_utils.clean_download(progress_status_list[index].path()) @@ -75,8 +77,6 @@ def mirror(update, context): aria.add_download(link) - - @run_async def cancel_mirror(update, context): pass