[Zope] standard_error_message

John Chandler johnc@nipltd.com
Tue, 2 May 2000 17:12:53 +0100 (GMT)


Apologies for my current posting frenzy ;-) Normal service will be resumed
shortly...

> However, I've found that the following as /standard_error_message seems
> to meet Chris' original requirement of overriding error methods in
> folders in the heirarchy.
> 
> This is the root /standard_error_message
> --------
> <dtml-try>
> <dtml-var "_.render(REQUEST.resolve_url(URL+'/std_error_message'))">
> <dtml-except>
> <html>
> <body>
> <h1>Standard error message</h1>
> </body>
> </html>
> </dtml-try>
> --------
> 
> Custom error messages go in std_error_message in each folder.
> When an error occurs, it is handled by the nearest std_error_message up
> the heirarchy.

Cheers. This is pretty close, I've just tried it out with suitably vile
colours to distinguish which instance of standard_error_message is being
used, and it does do the trick with everything except an invalid URL (404
errors).

For example a std_error_message in folder /foo/bar won't get used if
the requested URL is for /foo/bar/fred, but that shouldn't be too
difficult to solve by stepping back until something valid is found... I
would guess.
 
> I haven't tested it for errors in std_error_message yet.

What you get is something which looks like a hybrid of the root standard
error page embedded within the default error page... 

You can also use standard_error_message instead of std_error_message -
they both have the same desired effect.


Cheers,

John


--
 John Chandler  /  Software Developer  /  New Information Paradigms Ltd
   [ Linux in the office, AmigaOS in the home, PalmOS in the pocket ]
------------------------------------------------------------------------
 The opinions above aren't those of my company...
                           ...but then, they aren't really mine either.