[Zope] Mailing of Zope Errors to webmaster

John Chandler johnc@nipltd.com
Thu, 27 Apr 2000 17:35:31 +0100 (GMT)


> 	I would like to show my users a brief error message whenever it occurs
> and have the traceback mailed to the webmaster. Does someone have code
> on this that they could share?

We do something similar with our Zope site. If you look in your root
folder, you'll find a document called standard_error_message. Just put the
following code in this document (or call it from a dtml method):

<dtml-sendmail smtphost="mail">
To: webmaster@yourdomain.com
From: Zope Errors <zope_errors@yourdomain.com>
Subject: Zope error report

Error Location:
 <dtml-var SERVER_URL><dtml-var PATH_INFO>

Traceback:

<dtml-var error_tb>

</dtml-sendmail>


Of course, you'll probably want to customise the message a bit, but this
should give you a starting point. Any problems, let me know.

I wrote this and a few related topics up a while back, but never got round
to publishing them on the Zope site... I think I'll have to tidy it off
and make it public.


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.