Improve exception handling
This commit is contained in:
parent
00283dc55d
commit
037d18c52e
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue