[Zope] Intercepting NotFoundError with standard_error_message

Philipp Auersperg zope@philosoft.at
Fri, 01 Dec 2000 05:07:01 +0100


I need to intercept NotFoundErrors, but am banging my head against a problem

Normally this can be done by changing the standard_error_message, but there I have some questions:

considering a minimal standard_error_message:
--------------------------------------------------
<dtml-var standard_html_header>
Error!
<dtml-var standard_html_footer>
--------------------------------------------------

When I provoke an error by referencing a non-existent resource the message 'Error!' gets displayed, 
but there is also a traceback which I cannot suppress, it always gets displayed as a HTML comment

------------------------
and now my questions

0:
    How can I suppress this traceback totally, my main goal
    Even on zope.org whe NotFoundError returns such a hidden traceback :(

1:
     when I remove the standard_header and footer from my standard_error_message I would expect that just the word 'Error' gets displayed,
    But no way, then I get a detailed Zope Error message with a traceback.

     How can I archive that I just get the word 'Error!' or something similar as a result. I need that desperately because such an exception
     is unusable when calling methods via XMLRPC, there I need a simple clear error code and not a long traceback message.

2: what makes me most happy would be returning a single XMLRPC marshallable value by dtml-return:
----------------------------------------------------
    <dtml-return someErrorExpression>
----------------------------------------------------
    I already have such a standard_error_message but it just works for user-generated exception, but not for the #@%&§$ NotFoundError
    
   
I cannot believe that it is not possible to do error handling of NotFoundErrors but I've not found any information on that.

Thanks in advance

phil