[Zope3-dev] Re: [Zope-dev] Re: tal:on-error is a bare except...

Jim Fulton jim at zope.com
Sun Aug 22 21:15:38 EDT 2004


Tres Seaver wrote:
> Chris Withers wrote:
> 
>> Florent Guillaume wrote:
>>
>>> Not done for Z3 as this seems to not be a good idea there according to
>>> the gurus. 
>>
>>
>>
>> How so?
>>
>>> And supposedly ZODB 3.3 can cope with swallowed
>>> ConflictErrors
>>
>>
>>
>> Really?! Cool, I think, but I find this hard to believe.
>> Any anyone enlighten me? Tim?
> 
> 
> I don't believe the bare except is *ever* good form in 
> production-quality code.  *No* application-level code has enough zen to 
> swallow some kinds of exceptions, which is why the Java folks have a 
> separate RuntimeError hierarchy.

This isn't application level code.

> The fact that newer ZODB's *appear* to prevent later commits does not 
> exculpate the use of the bare except in 'tal:on-error' (emphasis added 
> to indicate a non-trivial amount of suspicion against the code paths in 
> question;  we have claimed to have solved that problem before).

Right, we have to do something different here. Adding a dependency on
ZODB isn't an option.  There needs to be some framework for deciding
which exceptions to catch and which not to.  It's hard though, because
we do want to catch conflict errors. We just don't want to catch them
anywhere but the publisher.

I'm open to suggestions that don't involve sprinling references to
ConflictError all over the place.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org



More information about the Zope3-dev mailing list