Browse Source

try to handle connection interrupts in net.download

keep-around/e977c9e07f177e8bc2b51265de1bc93475397f61
parazyd 6 years ago
parent
commit
5c55549a68
Signed by untrusted user: parazyd GPG Key ID: F0CB28FCF78637DE
  1. 6
      lib/net.py

6
lib/net.py

@ -19,7 +19,11 @@ def download(uris):
path = uris[1]
info("dl: %s" % url)
r = requests.get(url, stream=True)
try:
r = requests.get(url, stream=True)
except requests.exceptions.ConnectionError:
warn("Caught exception: Connection reset. Retrying.")
download(uris)
if r.status_code == 404:
warn("failed: 404 not found!")

Loading…
Cancel
Save