Add feed url to error logging

This commit is contained in:
Andreas Bielawski 2018-12-18 18:50:23 +01:00
parent 7267588e74
commit fafd04eb39

4
bot.py
View File

@ -256,9 +256,9 @@ def check_feed(bot, key):
data = feedparser.parse(feed_url) data = feedparser.parse(feed_url)
if 'link' not in data.feed: if 'link' not in data.feed:
if 'status' in data and data["status"] != 200: if 'status' in data and data["status"] != 200:
logger.warning('Kein gültiger Feed, HTTP-Status-Code ' + str(data["status"])) logger.warning(feed_url + ' - Kein gültiger Feed, HTTP-Status-Code ' + str(data["status"]))
else: else:
logger.warning('Kein gültiger Feed: ' + str(data.bozo_exception)) logger.warning(feed_url + ' - Kein gültiger Feed: ' + str(data.bozo_exception))
return None return None
if 'title' not in data.feed: if 'title' not in data.feed:
feed_title = data.feed['link'] feed_title = data.feed['link']