[Zope-dev] brain.getObject and traversal

Chris Withers chris at simplistix.co.uk
Mon Apr 4 09:27:50 EDT 2005


Florent Guillaume wrote:

> Is everyone ok with returning
>  - the object if it can be accessed
>  - raise Unauthorized if it can't be accessed
>  - raise NotFound if it's not there

Please don't catch any exceptions and re-raise them in a different type, 
just let them pass through.

I specifically don't think raising a normal NotFound when the catalog 
has a brain that doesn't map to an object is the right thing to do. I'd 
much prefer a BrainHasNoMatchingObject exception or some such which is 
nice and clear...

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list