[Zope-dev] brain.getObject and traversal

Dieter Maurer dieter at handshake.de
Fri Apr 1 15:41:00 EST 2005


Florent Guillaume wrote at 2005-4-1 13:21 +0200:
>Florent Guillaume  <fg at nuxeo.com> wrote:
>> >> Unauthorized in getObject is out of the question, that would be new 
>> >> behaviour.
>> > 
>> > Well, in 2.8, new behaviour is expected, right?
>> > I really passionately believe that we should not be returnining None in 
>> > Zope 2.8, and since 2.8 hasn't quite hit beta yet I'm very keen to see 
>> > it fixed asap.
>> > 
>> > Any objections?
>> 
>> I'm ok for 2.8. I'll look at it.
>
>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
>and never return None ?

Remapping exceptions is a bad idea.
Usually, valuable information is lost in the process.

If you change the "returning None", then you should let
through whatever exception is caused.

-- 
Dieter


More information about the Zope-Dev mailing list