Add exception handler for requests.exceptions.ReadTimeout in getXMLPageCore()

Treat a ReadTimeout the same as a ConnectionError (log the error & retry)
pull/394/head
Nicolas SAPA 4 years ago
parent 4a5eef97da
commit 7675b0d17c

@ -575,6 +575,9 @@ def getXMLPageCore(headers={}, params={}, config={}, session=None):
except requests.exceptions.ConnectionError as e:
print ' Connection error: %s'%(str(e[0]))
xml = ''
except requests.exceptions.ReadTimeout as e:
print ' Read timeout: %s'%(str(e[0]))
xml = ''
c += 1
return xml

Loading…
Cancel
Save