[Zope] help with customizing error messages, Zope 2.9

Dennis Allison allison at shasta.stanford.edu
Thu Sep 20 12:37:22 EDT 2007


Zope 2.9.X, python 2.4

I am in the process of making error messages suitable for a non-techie 
audience.  I want the "real" messages to go into the event log and a 
undetailed custom message to be displayed.  We'll probably want to be able 
to choose whether or not to display the non-techie messages since we do 
our development through the web.

I have been reading the code and am a bit confused.

standard_error_message is a DTML method at the root which is supposed 
to provide hooks for the application to specify it's own error messages.  

standard_error_message should be acquired.  It should be possible for
there to be multiple copies with the particular one to be used selected by
acquisition.  This does not appear to be the case for some errors in my
configuration, but I am not sure why.  

There appears to be nothing in the Zope 2.9 zope.conf file that has to do
with catching error messages.  Is there some configuration that is 
missing to enable full custom error messages.

Looking at the code:

ZPublisher/HTTPResponse.py seems to have a complete set of error
responses hard-wired with outputs that mimic those of the default
standard_error_message.

OFS/SimpleItem.py includes a method called raise_standardErrorMessage
which first acquires and then publishes the standard_error_message.

Zope2/App/startup.py has a method, zpublisher_exception_hook which 
uses raise_standardErrorMessage and is referenced in ZPublisher/Publish.py
where it is used to set error_hook, but error_hook does not appear to be 
used.

It would be helpful to me if someone who understands how this particular 
code works could provide some hints as to what's needed to fully customize 
the error message responses.





More information about the Zope mailing list