# HG changeset patch # User Goffi # Date 1556909674 -7200 # Node ID 75c5e8d21c7d8a1c48c2348954324be8d81d3a6f # Parent ddc1e704bc4161fb800d3e7e7a3ced6a03fba7c7 server: catch "not-allowed" error from bridge and show the appropriate error page in this case diff -r ddc1e704bc41 -r 75c5e8d21c7d libervia/server/pages.py --- a/libervia/server/pages.py Fri May 03 20:53:44 2019 +0200 +++ b/libervia/server/pages.py Fri May 03 20:54:34 2019 +0200 @@ -27,6 +27,7 @@ from sat.core import exceptions from sat.tools.common import date_utils from sat.core.log import getLogger +from sat_frontends.bridge.bridge_frontend import BridgeException from libervia.server.constants import Const as C from libervia.server import session_iface @@ -1241,6 +1242,9 @@ def _internalError(self, failure_, request): """called if an error is not catched""" + if failure_.check(BridgeException) and failure_.value.condition == u'not-allowed': + log.warning(u"not allowed exception catched") + self.pageError(request, C.HTTP_FORBIDDEN) log.error(_(u"Uncatched error for HTTP request on {url}: {msg}") .format( url=request.URLPath(), msg=failure_)) self.pageError(request, C.HTTP_INTERNAL_ERROR)