<!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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Traceback (innermost last):<BR>&nbsp; Module 
Zope2.App.startup, line 173, in zpublisher_exception_hook<BR>&nbsp; Module 
ZPublisher.Publish, line 121, in publish<BR>&nbsp; Module Zope2.App.startup, 
line 240, in commit<BR>&nbsp; Module transaction._manager, line 96, in 
commit<BR>&nbsp; Module transaction._transaction, line 380, in commit<BR>&nbsp; 
Module transaction._transaction, line 378, in commit<BR>&nbsp; Module 
transaction._transaction, line 433, in _commitResources<BR>&nbsp; Module 
ZODB.Connection, line 484, in commit<BR>&nbsp; Module ZODB.Connection, line 526, 
in _commit<BR>&nbsp; Module ZODB.Connection, line 554, in 
_store_objects<BR>&nbsp; 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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>in an external method, as follows:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; folder = 
self.unrestrictedTraverse(TEMPFOLDERIMAGES, 
None)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
try:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
folder.manage_addImage(imageId, imageData)</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
except:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;handle error message and return gracefully code&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV></FONT><FONT face=Arial size=2>The traceback does not&nbsp;show where the 
error originates in the external method, but there is only one place 
where&nbsp;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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Any ideas as to why the error trapping&nbsp;is not 
trapping?&nbsp; (running Zope 2.9.2, debug=on)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Jonathan</DIV></FONT></BODY></HTML>