From a8f267ded010966e106f6e16cc9bda4de1965022 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Wed, 11 Oct 2017 12:37:31 +0200 Subject: [PATCH] =?UTF-8?q?Verbessere=20Fehlermeldungen=20bei=20ung=C3=BCl?= =?UTF-8?q?tigem=20Feed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 706a2f9..88ae302 100644 --- a/bot.py +++ b/bot.py @@ -246,7 +246,10 @@ def check_feed(bot, key): logger.info(feed_url) data = feedparser.parse(feed_url) if 'link' not in data.feed: - logger.warning('Kein gültiger Feed, Status-Code ' + str(data["status"])) + if 'status' in data and data["status"] != 200: + logger.warning('Kein gültiger Feed, HTTP-Status-Code ' + str(data["status"])) + else: + logger.warning('Kein gültiger Feed: ' + str(data.bozo_exception)) return None if 'title' not in data.feed: feed_title = data.feed['link']