[Checkins] SVN: gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py Handling POSError and TransactionError on the thread

Dirceu Pereira Tiegs dirceutiegs at gmail.com
Fri Jul 18 09:46:11 EDT 2008


Log message for revision 88506:
  Handling POSError and TransactionError on the thread

Changed:
  U   gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py

-=-
Modified: gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py
===================================================================
--- gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py	2008-07-18 13:42:20 UTC (rev 88505)
+++ gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py	2008-07-18 13:46:10 UTC (rev 88506)
@@ -649,10 +649,15 @@
                 self.reliable = None
                 self.result = None
                 self.__apply_storage = __apply_storage
+                self.exception = None
             def run(self):
-                self.reliable, self.result = self.__apply_storage(
-                        self.name, self.method_name, self.args, 
-                        self.kw, self.expect_connected)
+                try:
+                    self.reliable, self.result = self.__apply_storage(
+                            self.name, self.method_name, self.args,
+                            self.kw, self.expect_connected)
+                except (ZODB.POSException.POSError,
+                        transaction.interfaces.TransactionError), e:
+                    self.exception = e
 
         results = []
         exceptions = []
@@ -686,6 +691,8 @@
             try:
                 thread.join(60)
                 reliable, result = thread.reliable, thread.result
+                if thread.exception:
+                    raise thread.exception
             except Exception, e:
                 exceptions.append(e)
                 raise



More information about the Checkins mailing list