Browse Source

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

pull/1/head
Hidden Z 14 years ago
parent
commit
af60e019f8
  1. 4
      py-i2phosts-fetcher

4
py-i2phosts-fetcher

@ -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
try:
content = resp.read() 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…
Cancel
Save