More usefull except logging

master
pictuga 2014-01-08 01:38:50 +01:00
parent a2402da32e
commit f12031cbdb
1 changed files with 4 additions and 4 deletions

View File

@ -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):