[Mpuls-commits] r2030 - wasko/branches/2.0/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 19 10:57:31 CET 2010


Author: torsten
Date: 2010-03-19 10:57:30 +0100 (Fri, 19 Mar 2010)
New Revision: 2030

Modified:
   wasko/branches/2.0/mpulsweb/model/case.py
Log:
Improved logging


Modified: wasko/branches/2.0/mpulsweb/model/case.py
===================================================================
--- wasko/branches/2.0/mpulsweb/model/case.py	2010-03-19 08:45:54 UTC (rev 2029)
+++ wasko/branches/2.0/mpulsweb/model/case.py	2010-03-19 09:57:30 UTC (rev 2030)
@@ -26,7 +26,6 @@
 # Authors:
 # Torsten Irländer <torsten.irlaender at intevation.de>
 #
-
 import logging
 
 import psycopg2.extras
@@ -252,8 +251,8 @@
             try:
                 case.setEditor(user_id)
                 num += 1
-            except:
-                print >> sys.stderr, "Could not set editor for case in bundle"
+            except Exception, e:
+                log.exception(e)
         return num
 
     def setStandin(self, group_ids):
@@ -265,8 +264,8 @@
                 standin = case.getStandin()
                 standin.setGroups(group_ids)
                 num += 1
-            except:
-                print >> sys.stderr, "Could not set standin for case in bundle"
+            except Exception, e:
+                log.exception(e)
         return num
 
     def delete(self):
@@ -277,8 +276,8 @@
             try:
                 case.delete()
                 num += 1
-            except:
-                print >> sys.stderr, "Could not delete Case from bundle"
+            except Exception, e:
+                log.exception(e)
         return num
 
     def anonymize(self):
@@ -289,8 +288,8 @@
             try:
                 case.anonymize()
                 num += 1
-            except:
-                print >> sys.stderr, "Could not anonymize Case from bundle"
+            except Exception, e:
+                log.exception(e)
         return num
 
     def restore(self):
@@ -301,8 +300,8 @@
             try:
                 case.restore()
                 num += 1
-            except StandardError, e:
-                print >> sys.stderr, "Could not restore case in bundle: %s" % e
+            except Exception, e:
+                log.exception(e)
         return num
 
     def markAnonymize(self):
@@ -313,9 +312,8 @@
             try:
                 case.getState().setState(4)
                 num += 1
-            except:
-                print >> sys.stderr, \
-                      "Could not mark case for anonymisation in bundle"
+            except Exception, e:
+                log.exception(e)
         return num
 
     def markDelete(self):
@@ -327,8 +325,8 @@
                 state = case.getState()
                 state.setState(3)
                 num += 1
-            except:
-                print >> sys.stderr, "Could not mark Case to delete from bundle"
+            except Exception, e:
+                log.exception(e)
         return num
 
 



More information about the Mpuls-commits mailing list