1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-02-08 12:54:23 +00:00

py-i2phosts-fetcher: handle httplib errors when fetching data

This commit is contained in:
Hidden Z 2010-10-30 17:57:34 +00:00
parent a7d98d8cf5
commit af60e019f8

View File

@ -87,7 +87,11 @@ for source in config['sources']:
source_hostname, e.code)
continue
# read data from remote and write it to local file
content = resp.read()
try:
content = resp.read()
except:
log.warning('failed to read data from %s', source_hostname)
continue
f = open(filename, 'w')
f.write(content)
f.close()