[Zope] Modifying Standard Error Pages
Martijn Pieters
mj@digicool.com
Tue, 21 Mar 2000 15:41:18 +0100
On Tue, Mar 21, 2000 at 02:24:47PM +0000, John Chandler wrote:
> I'm currently trying to modify Zope's standard error pages in order to
> have errors (such as 404 not founds or DTML errors) e-mailed to the
> webmaster as they occur.
>
> At first, I thought this would be as simple as modifying the
> standard_error_message document found in the root of the Zope
> installation, but it appears that changes to the file do not get displayed
> (even after forced refreshes) and thus it doesn't seem to be in use.
>
> A search on zope.org lead me to find the real error message embedded in
> <zopedir>/lib/python/OFS/Application.py - I've modified this and it
> appears to work, but doesn't support HTTP related errors such as 404s.
>
> After a bit of a search, I've tracked down HTTP-related error reports to
> <zopedir>/lib/python/ZPublisher/HTTPResponse.py but, while this can be
> modified, it doesn't support DTML as the HTML error message is returned
> without apparently being parsed by Zope. As a result, I can't have
> dtml-sendmail send an error message report.
>
> Okay, I could modify HTTPResponse.py to send a mail using something like
> Python's smtplib, but before I do that, have I overlooked the obvious and
> is there really a much cleaner, easier way to modify the error pages
> without delving into the sources?
Have a look at:
http://www.zope.org/standard_error_message/view_source
and you'll see how the Zope.org site handles 404 Not Found.
--
Martijn Pieters
| Software Engineer mailto:mj@digicool.com
| Digital Creations http://www.digicool.com/
| Creators of Zope http://www.zope.org/
| The Open Source Web Application Server
---------------------------------------------