Do not try again if the connection was reset

This commit is contained in:
Ali
2020-07-09 17:05:52 +03:00
parent 9d2b92f370
commit 88a74ee26a

View File

@@ -96,9 +96,8 @@ def getFile(filename,shortFilename,folderDir,imageURL,indent=0, silent=False):
os.rename(tempDir,fileDir) os.rename(tempDir,fileDir)
if not silent: print(" "*indent+"Downloaded"+" "*10) if not silent: print(" "*indent+"Downloaded"+" "*10)
return None return None
except ConnectionResetError as exception: except ConnectionResetError:
if not silent: print(" "*indent + str(exception)) raise FailedToDownload
if not silent: print(" "*indent + "Trying again\n")
except FileNotFoundError: except FileNotFoundError:
filename = shortFilename filename = shortFilename
else: else: