You can override the web.internalerror function to have it to do other
interesting things. For example, I have infogami send me an email with
the full debugerror traceback whenever there's a crash:
olderror = web.internalerror
def error():
    olderror()
    import sys, traceback
    tb = sys.exc_info()
    text = """From: the bugman <y...@example.com>
To: the bugfixer <y...@example.com>
Subject: bug: %s: %s (%s)
Content-Type: multipart/mixed; boundary="----here----"
------here----
Content-Type: text/plain
Content-Disposition: inline
%s
%s
------here----
Content-Type: text/html; name="bug.html"
Content-Disposition: attachment; filename="bug.html"
""" % (tb[0], tb[1], web.ctx.path, web.ctx.method+' '+web.ctx.home+web.ctx.f
ullpath,
     ''.join(traceback.format_exception(*tb)),
    text += str(web.djangoerror())
    utils.send('...@example.com', '...@example.com', text)
web.internalerror = error  


Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to