mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-02-08 21:04:17 +00:00
py-i2phosts-fetcher: handle httplib errors when fetching data
This commit is contained in:
parent
a7d98d8cf5
commit
af60e019f8
@ -87,7 +87,11 @@ for source in config['sources']:
|
|||||||
source_hostname, e.code)
|
source_hostname, e.code)
|
||||||
continue
|
continue
|
||||||
# read data from remote and write it to local file
|
# 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 = open(filename, 'w')
|
||||||
f.write(content)
|
f.write(content)
|
||||||
f.close()
|
f.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user