[Zope] Trying to trap ConflictError

Jonathan dev101 at magma.ca
Tue Jul 4 09:56:36 EDT 2006


I am trying to trap the following error:

Traceback (innermost last):
  Module Zope2.App.startup, line 173, in zpublisher_exception_hook
  Module ZPublisher.Publish, line 121, in publish
  Module Zope2.App.startup, line 240, in commit
  Module transaction._manager, line 96, in commit
  Module transaction._transaction, line 380, in commit
  Module transaction._transaction, line 378, in commit
  Module transaction._transaction, line 433, in _commitResources
  Module ZODB.Connection, line 484, in commit
  Module ZODB.Connection, line 526, in _commit
  Module ZODB.Connection, line 554, in _store_objects
  Module tempstorage.TemporaryStorage, line 200, in store
ConflictError: database conflict error (oid 0x39b0, class BTrees._OOBTree.OOBucket, serial this txn started with 0x0366974da4fd2288 2006-07-04 13:33:38.669252, serial currently committed 0x0366974da54d9fcc 2006-07-04 13:33:38.742942)


in an external method, as follows:

        folder = self.unrestrictedTraverse(TEMPFOLDERIMAGES, None)
        try:
                folder.manage_addImage(imageId, imageData)
        except:
                <handle error message and return gracefully code>


But the try/except block is not catching the error! (the error continues to show up in error_log)
(note: I started by trying "except ConflictError:", but that was not working, so I went to the bare try/except)

The traceback does not show where the error originates in the external method, but there is only one place where the external methods writes to TemporaryStorage. Does this indicate that the error is not bubbling up properly?

Any ideas as to why the error trapping is not trapping?  (running Zope 2.9.2, debug=on)

Thanks,


Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20060704/59e2f66d/attachment.htm


More information about the Zope mailing list