From f12031cbdbd28fb50bbf3fd7f2937d68aa7eefa8 Mon Sep 17 00:00:00 2001 From: pictuga Date: Wed, 8 Jan 2014 01:38:50 +0100 Subject: [PATCH] More usefull except logging --- morss.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/morss.py b/morss.py index 111bff7..0289443 100644 --- a/morss.py +++ b/morss.py @@ -453,8 +453,8 @@ def Fill(item, cache, feedurl='/', fast=False): url = link.encode('utf-8') con = urllib2.build_opener(SimpleDownload(accept=('html', 'text/*'), strict=True)).open(url, timeout=TIMEOUT) data = con.read() - except (IOError, httplib.HTTPException): - log('http error') + except (IOError, httplib.HTTPException) as e: + log('http error: %s' % e.message) cache.set(link, 'error-http') return True @@ -568,8 +568,8 @@ def Gather(url, cachePath, options): value = queue.get() try: worker(*value) - except: - log('random error in thread') + except Exception as e: + log('Thread Error: %s' % e.message) queue.task_done() def worker(i, item):