[Zope] standard_error_message

Chris Withers chrisw@nipltd.com
Tue, 02 May 2000 15:52:24 +0100


Steve,

I think John has chucked this in the collector. Personally I feel this whole
area a needs a thorough going over by someone who really understands it...

In the meantime, what would we *like* to have happen?

My vote is:

The nearest standard_error_message up the acquisition tree from where the error
occurs should be called, and in the context of the folder/container in which
that standard_error_message resides, for things like properties and acquired
object.

If this standard_error_message can't handle the error or is itself faulty and
causes an error then the next one up in the aquisition tree should be used, with
the rules above applied.

If no working/suitable standard_error_message's are found then Zope's hard coded
error message (which Steve was getting below...) should be thrown back as a last
resort.

Anyone agree? If so then what do we need to do to make this happen?
If not, then how should it be done?

cheers,

Chris

PS: "ZOPE: Together we'll crack it!" (for all those who watch UK TV ;-)

Steve Alexander wrote:
> 
> Steve Alexander wrote:
> >
> >
> > Checked it out like this:
> >
> > / (Zope root)
> >
> > -  standard_error_message  ( contains just <dtml-var std_error_message>
> > )
> > -  std_error_message       ( copy of original standard_error_message )
> > -  test                    ( folder )
> >      - std_error_message   ( contains
> >                             <html><body><h1>Test error message</h1>
> >                             </body></html> )
> >      - index_html          ( contains <dtml-var does_not_exist> )
> >
> > I try the url  "http://server/blarg", and I get the normal error message
> > I try the url  "http://server/test/blarg", and I get the normal error
> > message
> > I try the url  "http://server/test/index_html", and I get the test error
> > message
> > I try the url  "http://server/test", and I get the test error message
> >
> > So... limited success :-)
> 
> New experiment:
> 
> / (Zope root)
> 
> -  standard_error_message  -- contains just
>      <dtml-var
> "_.render(REQUEST.resolve_url(URL+'/std_error_message'))">
> 
> -  std_error_message       ( copy of original standard_error_message )
> -  test                    ( folder )
>      - std_error_message   ( contains
>                             <html><body><h1>Test error message</h1>
>                             </body></html> )
>      - index_html          ( contains <dtml-var does_not_exist> )
> 
> I try the url  "http://server/blarg", and I get the normal error message
> I try the url  "http://server/test/blarg", and I get the test error
> message
> I try the url  "http://server/test/index_html", and I get the test error
> message
> I try the url  "http://server/test", and I get the test error message
> 
> also...
> I try the url  "http://server/test/blarg/foo", and I get the test error
> message
> 
> Better!
> 
> There is just one strangeness. I've changed the text of
> /std_error_message, but for errors not caught by a std_error_message in
> a subdirectory, I get some sort of hard-coded error message -- Zope
> doesn't seem to be calling my root /standard_error_message at all in
> this case.
> 
> --
> Steve Alexander
> Software Engineer
> Cat-Box limited