Re: Changes to ZPublisher

Donovan Baarda <[email protected]>
Newsgroups gmane.comp.web.zope.coders
Organization http://minkirri.apana.org.au/~abo/
Message-ID <1097113489.1225.77.camel@schizo>
On Thu, 2004-10-07 at 11:24, Sidnei da Silva wrote:
> | Hmm... didn't notice that... nasty.
> | 
> | So what is the current way for a __bobo_traverse__ to indicate "object
> | does not exist" and result in a 404?
> 
> There's no way :) You could raise NotFound yourself, but then it
> breaks PageTemplates.
> 
> | Perhaps AttributeError = 404 is a good idea after all...
> 
> It's the best I could come up with.

It seems there are several possible solutions to this;

1) Fix PageTemplates so that NotFound doesn't break it (dunno what is
involved).

2) Fix returning None so that it returns 404 instead of "No Docstring",
and introduce some exception for the "No Docstring" case.

3) make AttributeError = 404, and document it like hell so people know
to catch them and raise as some other Error if they don't want a 404.

To me 1) seems like a good idea regardless. For 2) I really don't
understand why None results in "No Docstring"... is this really right?
If NotFound worked, I'm not sure what returning None should mean, but
"No Docstring" doesn't seem to be it. Option 3) seems unattractive to
me.

-- 
Donovan Baarda <[email protected]>
http://minkirri.apana.org.au/~abo/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.