[CalendarServer-changes] [11188] CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrade.py

source_changes at macosforge.org source_changes at macosforge.org
Wed May 15 09:20:42 PDT 2013


Revision: 11188
          http://trac.calendarserver.org//changeset/11188
Author:   sagen at apple.com
Date:     2013-05-15 09:20:42 -0700 (Wed, 15 May 2013)
Log Message:
-----------
Don't lose the original exception

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrade.py

Modified: CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrade.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrade.py	2013-05-15 16:20:02 UTC (rev 11187)
+++ CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrade.py	2013-05-15 16:20:42 UTC (rev 11188)
@@ -25,6 +25,7 @@
 from twext.python.log import LoggingMixIn
 
 from twisted.internet.defer import inlineCallbacks, returnValue
+from twisted.python.failure import Failure
 from twisted.python.modules import getModule
 from twisted.python.reflect import namedObject
 
@@ -124,9 +125,10 @@
             yield sqlTxn.commit()
         except (RuntimeError, ValueError):
             self.log_error("Database key %s cannot be determined." % (self.versionKey,))
+            f = Failure()
             yield sqlTxn.abort()
             if self.defaultKeyValue is None:
-                raise
+                f.raiseException()
             else:
                 actual_version = self.defaultKeyValue
 
@@ -264,8 +266,9 @@
             yield sqlTxn.execSQLBlock(sql)
             yield sqlTxn.commit()
         except RuntimeError:
+            f = Failure()
             yield sqlTxn.abort()
-            raise
+            f.raiseException()
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130515/76be79b9/attachment.html>


More information about the calendarserver-changes mailing list