mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
RSS: Display error instead of traceback if fetching a feed failed.
This commit is contained in:
parent
30f711b12f
commit
0c6320e9c1
@ -256,6 +256,7 @@ class RSS(callbacks.Plugin):
|
|||||||
# and DoS the website in question.
|
# and DoS the website in question.
|
||||||
self.acquireLock(url)
|
self.acquireLock(url)
|
||||||
if self.willGetNewFeed(url):
|
if self.willGetNewFeed(url):
|
||||||
|
results = None
|
||||||
try:
|
try:
|
||||||
self.log.debug('Downloading new feed from %u', url)
|
self.log.debug('Downloading new feed from %u', url)
|
||||||
results = feedparser.parse(url)
|
results = feedparser.parse(url)
|
||||||
@ -270,7 +271,9 @@ class RSS(callbacks.Plugin):
|
|||||||
# These seem mostly harmless. We'll need reports of a
|
# These seem mostly harmless. We'll need reports of a
|
||||||
# kind that isn't.
|
# kind that isn't.
|
||||||
self.log.debug('Allowing bozo_exception %r through.', e)
|
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.cachedFeeds[url] = results
|
||||||
self.lastRequest[url] = time.time()
|
self.lastRequest[url] = time.time()
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user