From f4b94165bb2e6e06eabcb05c4d5e5be4cd2265b7 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Sat, 12 Dec 2015 22:15:19 +0100 Subject: handling failing feed link --- src/web/lib/feed_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/web/lib/feed_utils.py b/src/web/lib/feed_utils.py index f39fe693..f3b18224 100644 --- a/src/web/lib/feed_utils.py +++ b/src/web/lib/feed_utils.py @@ -47,7 +47,11 @@ def construct_feed_from(url=None, fp_parsed=None, feed=None, query_site=True): or all(bool(feed.get(k)) for k in ('link', 'title', 'icon_url')): return feed - response = requests.get(feed['site_link'], verify=False) + try: + response = requests.get(feed['site_link'], verify=False) + except Exception: + logger.exception('failed to retreive %r', feed['site_link']) + return feed bs_parsed = BeautifulSoup(response.content, 'html.parser', parse_only=SoupStrainer('head')) -- cgit