[Zope-CVS] CVS: Products/Ape/lib/apelib/zodb3 - storage.py:1.14

Shane Hathaway shane at zope.com
Tue Mar 16 22:59:11 EST 2004


Update of /cvs-repository/Products/Ape/lib/apelib/zodb3
In directory cvs.zope.org:/tmp/cvs-serv19215

Modified Files:
	storage.py 
Log Message:
In APE_MAPPER_DEBUG mode, reveal the reason for conflicts.


=== Products/Ape/lib/apelib/zodb3/storage.py 1.13 => 1.14 ===
--- Products/Ape/lib/apelib/zodb3/storage.py:1.13	Thu Mar 11 00:47:05 2004
+++ Products/Ape/lib/apelib/zodb3/storage.py	Tue Mar 16 22:59:11 2004
@@ -140,9 +140,14 @@
                     if h is None:
                         h = h64
                         old_hash = old_h64
-                    raise POSException.ConflictError(
-                        "Storing %s based on old data.  %s != %s." % (
+                    error = ("Storing %s based on old data.  %s != %s." % (
                         repr(oid), repr(h), repr(old_hash)))
+                    if DEBUG:
+                        # Expose the error for debugging..
+                        raise RuntimeError(error)
+                    else:
+                        # Use normal ZODB conflict errors.
+                        raise POSException.ConflictError(error)
 
             # Now unpickle and store the data.
             file = StringIO(data)




More information about the Zope-CVS mailing list