Improve exception handling

This commit is contained in:
Klaus-Uwe Mitterer 2017-09-13 18:15:53 +02:00
parent 00283dc55d
commit 037d18c52e

View file

@ -67,7 +67,7 @@ def fileHandler(url, retry = False):
with open("files/sbd%s_%s" % (fid, fname), "wb") as out:
out.write(res.content)
except requests.exceptions.ConnectionError:
except (requests.exceptions.ConnectionError, requests.exceptions.ChunkedEncodingError):
if not retry:
time.sleep(10)
fileHandler(url, True)