Do not try again if the connection was reset
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user