[session] raise proper exception with get_tx is called on a closed session
authorpierre-yves
Thu, 23 May 2013 19:25:24 +0200
changeset 8996 dcd8aa47adce
parent 8995 a90a98800578
child 8997 525915f8bc1c
[session] raise proper exception with get_tx is called on a closed session Prevent attribute error on _txs Closes #2897836
server/session.py
--- a/server/session.py	Thu Jun 06 09:44:37 2013 +0200
+++ b/server/session.py	Thu May 23 19:25:24 2013 +0200
@@ -865,6 +865,8 @@
         Transaction is created if necessary"""
         with self._lock: # no transaction exist with the same id
             try:
+                if self.closed:
+                    raise SessionClosedError('try to access connections set on a closed session %s' % self.id)
                 tx = self._txs[txid]
             except KeyError:
                 rewriter = RQLRewriter(self)