[Zope] More questions about standard_error_message

Christopher J. Kucera ckucera@globalcrossing.com
Fri, 14 Apr 2000 10:34:12 -0500


John Chandler wrote:
> around through all the different Zope resources for an answer. It'd be
> much appreciated if anyone, particularly at DC, has any comments.

Well, I'm not from DC, but I'll see what I can do. :)

> 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?

Your example works for me . . .  How exactly are you raising the error?

  1) If you're playing some games with acquisition, make sure you're actually
     calling the standard_error_message you think you are.  Say there's
     a method, "AnError" in your root directory that raises an error.
     If it's called as "/foo/AnError", you'll get the error message from
     /foo, but if you call it as "/foo/bar/AnError", you'll get the error
     message from the root folder.

  2) Are you sure you're getting to your error message at all?  If there's
     an error of some sort in standard_error_message itself, Zope will\
     display a default error message that's *not* a standard_error_message
     anywhere.  This could possibly be related to your RESPONSE.redirects
     you were trying before.

> 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.

Again, how are you raising the errors . . .  The acquisition stuff I
mentioned before can bite you here, too.

Hope any of this helps!

-CJ