commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r8185 - trunk/gnue-forms/src


From: johannes
Subject: [gnue] r8185 - trunk/gnue-forms/src
Date: Thu, 2 Mar 2006 08:43:00 -0600 (CST)

Author: johannes
Date: 2006-03-02 08:42:59 -0600 (Thu, 02 Mar 2006)
New Revision: 8185

Modified:
   trunk/gnue-forms/src/GFForm.py
Log:
Don't catch our own exceptions


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2006-03-02 14:06:44 UTC (rev 8184)
+++ trunk/gnue-forms/src/GFForm.py      2006-03-02 14:42:59 UTC (rev 8185)
@@ -677,71 +677,65 @@
     self.dispatchEvent ('beginWAIT', _form = self)
 
     try:
+      # Save all current records, since they get lost in the Pre-Commit code
+      for block in self._logic._blockList:
+        block._precommitRecord = block._currentRecord
+
+      # Form level pre-commit triggers
       try:
-        # Save all current records, since they get lost in the Pre-Commit code
-        for block in self._logic._blockList:
-          block._precommitRecord = block._currentRecord
+        self.processTrigger ('Pre-Commit', ignoreAbort = False)
 
-        # Form level pre-commit triggers
-        try:
-          self.processTrigger ('Pre-Commit', ignoreAbort = False)
+      except AbortRequest:
+        assert gDebug (5, "Trigger form Pre-Commit threw a AbortRequest!")
+        message = u_("Form trigger returned error")
 
-        except AbortRequest:
-          assert gDebug (5, "Trigger form Pre-Commit threw a AbortRequest!")
-          message = u_("Form trigger returned error")
 
-
-        # Process the commit on all blocks
-        for block in self._logic._blockList:
-          assert gDebug (5, "Saving %s" % block.name)
-          try:
-            block.processCommit ()
-
-          except AbortRequest:
-            assert gDebug (5, "Trigger block Pre-Commit threw a AbortRequest!")
-            message = u_("Block trigger returned error")
-            # jump to offending block
-            newBlock = block
-          except:
-            # jump to offending block
-            newBlock = block
-            raise
-
+      # Process the commit on all blocks
+      for block in self._logic._blockList:
+        assert gDebug (5, "Saving %s" % block.name)
         try:
-          # Now do the real commit () on the backend connections (only once per
-          # connection, if multiple blocks are sharing the same connection)
-          for conn in self.__getConnections ().values ():
-            conn.commit ()
+          block.processCommit ()
 
+        except AbortRequest:
+          assert gDebug (5, "Trigger block Pre-Commit threw a AbortRequest!")
+          message = u_("Block trigger returned error")
+          # jump to offending block
+          newBlock = block
         except:
-          # Make sure the block is in consistent state again; this has to be
-          # done in any case if the processCommit was successful, even if the
-          # connection commit failed!
-          for block in self._logic._blockList:            
-            block.finalizeCommit (False)
+          # jump to offending block
+          newBlock = block
           raise
 
+      try:
+        # Now do the real commit () on the backend connections (only once per
+        # connection, if multiple blocks are sharing the same connection)
+        for conn in self.__getConnections ().values ():
+          conn.commit ()
+
+      except:
+        # Make sure the block is in consistent state again; this has to be
+        # done in any case if the processCommit was successful, even if the
+        # connection commit failed!
         for block in self._logic._blockList:            
-          block.finalizeCommit (True)
+          block.finalizeCommit (False)
+        raise
 
-        # Execute Post-Commit-Trigger for each block
-        for block in self._logic._blockList:
-          block.processTrigger ('Post-Commit')
+      for block in self._logic._blockList:            
+        block.finalizeCommit (True)
 
-        for block in self._logic._blockList:
-          if block.autoClear:
-            block.processClear ()
+      # Execute Post-Commit-Trigger for each block
+      for block in self._logic._blockList:
+        block.processTrigger ('Post-Commit')
 
-        self.dispatchEvent ('cannotCOMMIT')
-        self.dispatchEvent ('cannotROLLBACK')
+      for block in self._logic._blockList:
+        if block.autoClear:
+          block.processClear ()
 
-        # Execute Post-Commit-Trigger for the form
-        self.processTrigger ('Post-Commit')
+      self.dispatchEvent ('cannotCOMMIT')
+      self.dispatchEvent ('cannotROLLBACK')
 
-      except DBError:
-        message = u_("Database commit error:\n%(exType)s\n%(exMessage)s") \
-            % {'exType'   : sys.exc_info ()[0],
-               'exMessage': sys.exc_info ()[1]}               
+      # Execute Post-Commit-Trigger for the form
+      self.processTrigger ('Post-Commit')
 
     finally:
       # Make sure the current block still has the focus, even if an exception





reply via email to

[Prev in Thread] Current Thread [Next in Thread]