[Zope] sending email from a standard_error_message.

Martijn Pieters mj@antraciet.nl
Wed, 28 Apr 1999 10:12:10 +0200


At 09:04 28/04/99 , Anthony Baxter wrote:
>I'd look at doing this myself, but I seem to remember someone
>else already posted saying they'd done this:
>
>I'd like a standard_error_message that sends email to an
>administrative mailbox, with a traceback, REQUEST contents,
>and the like. Has anyone tackled this?
>
>Alternatively, how about simply storing the data in the
>zobobase? 
>
>Anthony

I did tackle this, but switched it off again, because the email sending
takes a moment... Damn anoying if you made a type in a DTML Method, and
click view to test it. I guess you could put a test in there to see if the
user has the Anonymous role or something...

Just place a sendmail tag in the error message, and put things like
<!--#var REQUEST--> in it's body.

Error related variables you could place into the email are:
error_type: type of the exception being handled (string or object)
error_value: exception parameter (second argument to a raise statement)
error_tb: Traceback object (or string, if no object is available)
error_traceback: Traceback string, usually nicely formatted.
error_message: Optional HTML message. (I think.....)


--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------