# HG changeset patch # User Sylvain Thénault # Date 1317729552 -7200 # Node ID 71c70bf482cf8f41ec5367e5fb36840787c793ee # Parent faec7589f7427acdddcf9a877fbc0810a4339c4a [web session] ProgrammingError may be raised, we should catch it (closes #1980076) diff -r faec7589f742 -r 71c70bf482cf dbapi.py --- a/dbapi.py Tue Oct 04 13:58:57 2011 +0200 +++ b/dbapi.py Tue Oct 04 13:59:12 2011 +0200 @@ -254,6 +254,8 @@ def anonymous_session(self): return not self.cnx or self.cnx.anonymous_connection + def __repr__(self): + return '' % self.sessionid class DBAPIRequest(RequestSessionBase): diff -r faec7589f742 -r 71c70bf482cf web/views/sessions.py --- a/web/views/sessions.py Tue Oct 04 13:58:57 2011 +0200 +++ b/web/views/sessions.py Tue Oct 04 13:59:12 2011 +0200 @@ -25,7 +25,7 @@ BadConnectionId) from cubicweb.web import InvalidSession, Redirect from cubicweb.web.application import AbstractSessionManager -from cubicweb.dbapi import DBAPISession +from cubicweb.dbapi import ProgrammingError, DBAPISession class InMemoryRepositorySessionManager(AbstractSessionManager): @@ -133,6 +133,6 @@ if session.cnx: try: session.cnx.close() - except BadConnectionId: # expired on the repository side + except (ProgrammingError, BadConnectionId): # expired on the repository side pass session.cnx = None