<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I am trying to trap the following
error:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Traceback (innermost last):<BR> Module
Zope2.App.startup, line 173, in zpublisher_exception_hook<BR> Module
ZPublisher.Publish, line 121, in publish<BR> Module Zope2.App.startup,
line 240, in commit<BR> Module transaction._manager, line 96, in
commit<BR> Module transaction._transaction, line 380, in commit<BR>
Module transaction._transaction, line 378, in commit<BR> Module
transaction._transaction, line 433, in _commitResources<BR> Module
ZODB.Connection, line 484, in commit<BR> Module ZODB.Connection, line 526,
in _commit<BR> Module ZODB.Connection, line 554, in
_store_objects<BR> Module tempstorage.TemporaryStorage, line 200, in
store<BR>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)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>in an external method, as follows:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> folder =
self.unrestrictedTraverse(TEMPFOLDERIMAGES,
None)<BR>
try:<BR>
folder.manage_addImage(imageId, imageData)</FONT></DIV>
<DIV><FONT face=Arial size=2>
except:<BR>
<handle error message and return gracefully code></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>But the try/except block is not catching the error!
(the error continues to show up in error_log)</FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>(note: I started by trying "except ConflictError:",
but that was not working, so I went to the bare try/except)</FONT></DIV>
<DIV> </DIV>
<DIV></FONT><FONT face=Arial size=2>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?</FONT></DIV></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any ideas as to why the error trapping is not
trapping? (running Zope 2.9.2, debug=on)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jonathan</DIV></FONT></BODY></HTML>