[Zope] More questions about standard_error_message

John Chandler johnc@nipltd.com
Fri, 14 Apr 2000 16:17:07 +0100 (GMT)


A couple of questions about the behaviour of standard_error_message - I've
asked one of these on this list before and didn't get a reply, so probably
won't get a reply now, but I've been really scratching my head and sifting
around through all the different Zope resources for an answer. It'd be
much appreciated if anyone, particularly at DC, has any comments.

First question is about getting standard_error_message to redirect.
RESPONSE.redirect() calls don't work in standard_error_message, while they
do in other contexts. The reason I'm doing this is to take a 404 error,
look up the intended URL in a database table and transparently redirect to
a new URL if one has been defined. Otherwise it displays a normal "not
found" error. Is there any way of getting this redirection to happen?

I'm also  interested as to why it doesn't happen, since the DTML contents
is presumably being parsed by Zope in the same way other documents are...
but perhaps it isn't.

The second question is about overriding the standard_error_message seen
for a given folder. What I'd like to be able to have is:

/standard_error_message
 foo/
   standard_error_message
 bar/
 baz/

Thus, errors occuring within foo/ use a different standard_error_message
to those elsewhere. However, this doesn't appear to happen so I can only
presume the standard_error_message called is always the one in the root.
Is there any way around this other than to explicitly check the URL
causing the error and take the appropriate action?

Ditto goes for a property such as ErrorsTo containing, say, the e-mail
address of someone to report errors to. If I have:

/ErrorsTo = webmaster@foo.org
 foo/
 bar/
   ErrorsTo = bar-errors@foo.org
 baz/
   ErrorsTo = errors@baz.com

I'd like standard_error_message to acquire the appropriate ErrorsTo
property, but unfortunately this doesn't happen and the ErrorsTo property
will always be webmaster@foo.org for standard_error_message.

I've rummaged through the docs on Zope.org, searched the mailing lists and
even had a nose around the source without much luck. Anyone have
information about standard_error_message?

Anything learnt will be documented and put onto the Zope site, I've
already made a start but these two topics are frustrating to solve.


Thanks in advance.

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.