More usefull except logging
parent
a2402da32e
commit
f12031cbdb
8
morss.py
8
morss.py
|
@ -453,8 +453,8 @@ def Fill(item, cache, feedurl='/', fast=False):
|
||||||
url = link.encode('utf-8')
|
url = link.encode('utf-8')
|
||||||
con = urllib2.build_opener(SimpleDownload(accept=('html', 'text/*'), strict=True)).open(url, timeout=TIMEOUT)
|
con = urllib2.build_opener(SimpleDownload(accept=('html', 'text/*'), strict=True)).open(url, timeout=TIMEOUT)
|
||||||
data = con.read()
|
data = con.read()
|
||||||
except (IOError, httplib.HTTPException):
|
except (IOError, httplib.HTTPException) as e:
|
||||||
log('http error')
|
log('http error: %s' % e.message)
|
||||||
cache.set(link, 'error-http')
|
cache.set(link, 'error-http')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -568,8 +568,8 @@ def Gather(url, cachePath, options):
|
||||||
value = queue.get()
|
value = queue.get()
|
||||||
try:
|
try:
|
||||||
worker(*value)
|
worker(*value)
|
||||||
except:
|
except Exception as e:
|
||||||
log('random error in thread')
|
log('Thread Error: %s' % e.message)
|
||||||
queue.task_done()
|
queue.task_done()
|
||||||
|
|
||||||
def worker(i, item):
|
def worker(i, item):
|
||||||
|
|
Loading…
Reference in New Issue