From 88a74ee26ab61134cde2be024af18cb53ded15e8 Mon Sep 17 00:00:00 2001 From: Ali Date: Thu, 9 Jul 2020 17:05:52 +0300 Subject: [PATCH] Do not try again if the connection was reset --- src/downloaders/downloaderUtils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/downloaders/downloaderUtils.py b/src/downloaders/downloaderUtils.py index 3508549..d8ba74a 100644 --- a/src/downloaders/downloaderUtils.py +++ b/src/downloaders/downloaderUtils.py @@ -96,9 +96,8 @@ def getFile(filename,shortFilename,folderDir,imageURL,indent=0, silent=False): os.rename(tempDir,fileDir) if not silent: print(" "*indent+"Downloaded"+" "*10) return None - except ConnectionResetError as exception: - if not silent: print(" "*indent + str(exception)) - if not silent: print(" "*indent + "Trying again\n") + except ConnectionResetError: + raise FailedToDownload except FileNotFoundError: filename = shortFilename else: