From 0c6320e9c1b7c196a37351991d3f1dfade1e1335 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 26 Aug 2012 07:38:40 +0000 Subject: [PATCH] RSS: Display error instead of traceback if fetching a feed failed. --- plugins/RSS/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/RSS/plugin.py b/plugins/RSS/plugin.py index 5db8aade2..580af283a 100644 --- a/plugins/RSS/plugin.py +++ b/plugins/RSS/plugin.py @@ -256,6 +256,7 @@ class RSS(callbacks.Plugin): # and DoS the website in question. self.acquireLock(url) if self.willGetNewFeed(url): + results = None try: self.log.debug('Downloading new feed from %u', url) results = feedparser.parse(url) @@ -270,7 +271,9 @@ class RSS(callbacks.Plugin): # These seem mostly harmless. We'll need reports of a # kind that isn't. self.log.debug('Allowing bozo_exception %r through.', e) - if results.get('feed', {}): + if results is None: + self.log.error('Could not fetch feed %s' % url) + elif results.get('feed', {}): self.cachedFeeds[url] = results self.lastRequest[url] = time.time() else: