# HG changeset patch # User Goffi # Date 1522132597 -7200 # Node ID 2c2b8c08e6c9256aff141e592d5fe61e9cd85057 # Parent 3af28f84ce9137403744559f3f76d4d28fc031de pages (forums): log a warning and use an empty list when forums are not available diff -r 3af28f84ce91 -r 2c2b8c08e6c9 src/pages/forums/list/page_meta.py --- a/src/pages/forums/list/page_meta.py Tue Mar 27 08:35:37 2018 +0200 +++ b/src/pages/forums/list/page_meta.py Tue Mar 27 08:36:37 2018 +0200 @@ -4,6 +4,7 @@ from libervia.server.constants import Const as C from twisted.internet import defer from sat.core.log import getLogger +from sat.core.i18n import _ from sat.tools.common import uri as xmpp_uri log = getLogger('pages/forum') import json @@ -40,8 +41,13 @@ service, node, key = data[u'service'], data[u'node'], data[u'forum_key'] profile = self.getProfile(request) or C.SERVICE_PROFILE - forums_raw = yield self.host.bridgeCall('forumsGet', service.full() if service else u'', node, key, profile) - forums = json.loads(forums_raw) + try: + forums_raw = yield self.host.bridgeCall('forumsGet', service.full() if service else u'', node, key, profile) + except Exception as e: + log.warning(_(u"Can't retrieve forums: {msg}").format(msg=e)) + forums = [] + else: + forums = json.loads(forums_raw) getLinks(self, forums) template_data[u'forums'] = forums