From 54113960c5633c4f43865f68c8463e05d1cfbc1a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 18 Jul 2009 06:50:40 -0400 Subject: [PATCH] Added tracebacks to be-handle-mail's "uncaught exceptions". --- interfaces/email/interactive/be-handle-mail | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interfaces/email/interactive/be-handle-mail b/interfaces/email/interactive/be-handle-mail index 13dd039..caa833c 100755 --- a/interfaces/email/interactive/be-handle-mail +++ b/interfaces/email/interactive/be-handle-mail @@ -37,6 +37,7 @@ import os.path import send_pgp_mime import sys import time +import traceback SUBJECT_COMMENT = "[be-bug]" HANDLER_ADDRESS = "BE Bugs " @@ -258,6 +259,7 @@ def main(): except Exception, e: if LOGFILE != None: LOGFILE.write("Uncaught exception:\n%s\n" % (e,)) + traceback.print_tb(sys.exc_traceback, file=LOGFILE) close_logfile() sys.exit(1) response_email = compose_response(ret, out_text, err_text, info).plain() @@ -265,7 +267,6 @@ def main(): print send_pgp_mime.flatten(response_email) else: send_pgp_mime.mail(response_email, send_pgp_mime.sendmail) - close_logfile() if __name__ == "__main__": -- 2.26.2