handle key error when news feed does not load

workspace
Brendan Howell 4 years ago
parent d9a71d853e
commit d107a45797

@ -298,9 +298,14 @@ class Publications(Bureau):
thread.join() thread.join()
for source in feeds: for source in feeds:
feed = feedparser.parse(feed_data[source["url"]]) try:
feed = feedparser.parse(feed_data[source["url"]])
except KeyError:
self.log.debug("Skipping missing feed data (network problem?):%s", source["url"])
continue
if feed is None: if feed is None:
continue continue
num_entries = source["count"] num_entries = source["count"]
# work around if we don't have enough news # work around if we don't have enough news

Loading…
Cancel
Save