[Mpuls-commits] r3633 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Sep 14 20:39:25 CEST 2010


Author: bh
Date: 2010-09-14 20:39:24 +0200 (Tue, 14 Sep 2010)
New Revision: 3633

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/evaluate.py
Log:
* mpulsweb/controllers/evaluate.py (EvaluateController.evaluate)
(EvaluateController.evaluateAction): Use log.exception instead of
log.error.  Now there's no need to print or log the traceback
explicitly.
(EvaluateController.evaluateAction): Log the exception when
validating the parameters fails


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-09-14 18:29:14 UTC (rev 3632)
+++ base/trunk/ChangeLog	2010-09-14 18:39:24 UTC (rev 3633)
@@ -1,5 +1,14 @@
 2010-09-14  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/controllers/evaluate.py (EvaluateController.evaluate)
+	(EvaluateController.evaluateAction): Use log.exception instead of
+	log.error.  Now there's no need to print or log the traceback
+	explicitly.
+	(EvaluateController.evaluateAction): Log the exception when
+	validating the parameters fails
+
+2010-09-14  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/model/case.py (MpulsCaseList.__nonzero__)
 	(MpulsCaseList.__len__): New methods to make it easier to
 	determine how many cases are contained in the case list.

Modified: base/trunk/mpulsweb/controllers/evaluate.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluate.py	2010-09-14 18:29:14 UTC (rev 3632)
+++ base/trunk/mpulsweb/controllers/evaluate.py	2010-09-14 18:39:24 UTC (rev 3633)
@@ -116,8 +116,7 @@
                 c.evalconfig = EvaluationConfig(config_file, conn, None, None,
                                                 None, None, None, None, None)
             except:
-                print 'Error: Evaluation failed %s' % traceback.print_exc()
-                log.error(_('Error: Evaluation failed'))
+                log.exception(_('Error: Evaluation failed'))
         finally:
             db.recycleConnection(conn, cur)
 
@@ -207,6 +206,7 @@
         try:
             form_result = validator.to_python(params)
         except formencode.Invalid, error:
+            log.exception("Error while decoding form parameters")
             form_result = error.value
             form_errors = error.error_dict or {}
             c.evaloptions = get_search_options(session.get('evaluation.options'),
@@ -238,8 +238,7 @@
                                                   errors=form_errors,
                                                   auto_insert_errors=False)
             except:
-                log.error(_('Error: Evaluation failed'))
-                log.error(traceback.print_exc())
+                log.exception(_('Error: Evaluation failed'))
         finally:
             db.recycleConnection(conn, cur)
 



More information about the Mpuls-commits mailing list