diff --git a/informed_decision/web.py b/informed_decision/web.py index 6730947..b3ea736 100644 --- a/informed_decision/web.py +++ b/informed_decision/web.py @@ -188,7 +188,7 @@ class App: if method == "GET" and path == "/": if session: content = (f"
Signed in as {html.escape(session.subject)}.
" - + (overview_section(self.review.overview(session)) if self.review is not None else '') + + (self._overview(session) if self.review is not None else '') + ('Enter the memo identifier supplied with your review request.
' '' if self.review is not None else @@ -201,6 +201,19 @@ class App: return 200, document("Informed Decision", content, session.subject if session else None), "text/html", [] return 404, "Not found.", "text/plain", [] + def _overview(self, session): + # The overview is orientation only. Its failure must never take the + # memo form, sign-out or an unresolved-entry recovery path with it. + try: + return overview_section(self.review.overview(session)) + except ReviewError as exc: + if exc.code == "session_expired": + raise + except (PolicyError, ApprovalEngineError, StoreError, sqlite3.Error, ValueError, KeyError, TypeError): + pass + return ('