Browse Source

Handle uncaught ConnectionResetError in net/download.

keep-around/0c33c2d195c702f928e0e4299fed9ca8252eb85f
parazyd 4 years ago
parent
commit
0c33c2d195
Signed by untrusted user: parazyd GPG Key ID: F0CB28FCF78637DE
  1. 3
      lib/net.py

3
lib/net.py

@ -22,7 +22,8 @@ def download(uris):
try:
rfile = requests.get(url, stream=True, timeout=20)
except (requests.exceptions.ConnectionError,
requests.exceptions.ReadTimeout) as err:
requests.exceptions.ReadTimeout,
ConnectionResetError) as err:
warn('Caught exception: "%s". Retrying...' % err)
return download(uris)

Loading…
Cancel
Save