From ec55fc2ee8e8696d5964ed1a01854d2b7e7bdf8d Mon Sep 17 00:00:00 2001 From: Grgoire Dtrez Date: Tue, 20 May 2008 20:35:43 +0200 Subject: [PATCH] Petites modifications dans l'envoie de mails par l'intranet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sujet plus explicite et une exception moins incompréhensible pour les tests. darcs-hash:20080520183543-69ccb-0d724b8011507a10e48cb394a992a1e7592af1a3.gz --- intranet/ClassesIntranet/Intranet.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/intranet/ClassesIntranet/Intranet.py b/intranet/ClassesIntranet/Intranet.py index e95f5a3c..2d40c124 100755 --- a/intranet/ClassesIntranet/Intranet.py +++ b/intranet/ClassesIntranet/Intranet.py @@ -160,7 +160,11 @@ Ceci est un rapport de bug envoye par l'intranet. tb = crans.utils.exceptions.formatExc() text += "\n= Traceback =\n" text += tb - + try: + errorString = tb.split("\n")[-2] + subject = "[Error] %s" % errorString + except: pass + text +="\n= Autres informations =\n" autres_informations = "\n".join( [ "%s: %s" % (str(a), str(kw[a])) for a in kw] ) text += autres_informations @@ -194,7 +198,7 @@ Ceci est un rapport de bug envoye par l'intranet. send_error_repport.exposed = True def testErreur(self): - raise Exception, "sdlfkjqmsdklj" + raise Exception, "Fausse alerte ! (test du systèmede gestion des erreurs)" testErreur.exposed = True