diff options
Diffstat (limited to 'src/web/views')
-rw-r--r-- | src/web/views/feed.py | 5 | ||||
-rw-r--r-- | src/web/views/views.py | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/web/views/feed.py b/src/web/views/feed.py index 69972958..9de45a7e 100644 --- a/src/web/views/feed.py +++ b/src/web/views/feed.py @@ -1,5 +1,6 @@ #! /usr/bin/env python # -*- coding: utf-8 - +import logging import requests.exceptions from datetime import datetime, timedelta from sqlalchemy import desc @@ -18,6 +19,7 @@ from web.forms import AddFeedForm from web.controllers import (CategoryController, FeedController, ArticleController) +logger = logging.getLogger(__name__) feeds_bp = Blueprint('feeds', __name__, url_prefix='/feeds') feed_bp = Blueprint('feed', __name__, url_prefix='/feed') @@ -114,6 +116,9 @@ def bookmarklet(): flash(gettext("Impossible to connect to the address: {}.".format(url)), "danger") return redirect(url_for('home')) + except Exception: + logger.exception('something bad happened when fetching %r', url) + return redirect(url_for('home')) if not feed.get('link'): feed['enabled'] = False flash(gettext("Couldn't find a feed url, you'll need to find a Atom or" diff --git a/src/web/views/views.py b/src/web/views/views.py index f8549e93..1aed912d 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -262,6 +262,8 @@ def get_menu(): categories[feed['category_id']]['unread'] += feed['unread'] categories[feed['category_id']]['feeds'].append(feed_id) return jsonify(**{'feeds': feeds, 'categories': categories, + 'crawling_method': conf.CRAWLING_METHOD, + 'is_admin': g.user.is_admin(), 'all_unread_count': sum(unread.values())}) |