[Mpuls-commits] r1496 - wasko/branches/2.0/mpulsweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Feb 11 08:55:34 CET 2010
Author: torsten
Date: 2010-02-11 08:55:30 +0100 (Thu, 11 Feb 2010)
New Revision: 1496
Modified:
wasko/branches/2.0/mpulsweb/controllers/document.py
Log:
* mpulsweb/controllers/document.py (DocumentController): Improved
exception handling (use logging module to log exceptions).
Modified: wasko/branches/2.0/mpulsweb/controllers/document.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/document.py 2010-02-11 07:49:12 UTC (rev 1495)
+++ wasko/branches/2.0/mpulsweb/controllers/document.py 2010-02-11 07:55:30 UTC (rev 1496)
@@ -86,10 +86,9 @@
def globalOverview(self):
try:
c.files = listDocuments()
- except:
- traceback.print_exc(file=sys.stderr)
- c.files = []
- #return render('/tests/trace.mako')
+ except Exception, e:
+ log.exception(e)
+ raise
return render('/documents/global_overview.mako')
@checkRole('admin_ka')
@@ -116,8 +115,8 @@
myfile.file.close()
except:
pass
- except:
- traceback.print_exc(file=sys.stderr)
+ except Exception, e:
+ log.exception(e)
c.failed_for = SET_DOCUMENT_FAILED_HEADER
c.failed_text = SET_DOCUMENT_FAILED_TEXT
c.url_ok = h.url_for(controller="document", action="globalUpload")
@@ -137,10 +136,9 @@
cache_control='must-revalidate',
pragma='public')
return data(request.environ, self.start_response)
- except:
- traceback.print_exc(file=sys.stderr)
+ except Exception, e:
+ log.exception(e)
redirect_to(controller="case", action="documents", id=case)
- #return render('/tests/trace.mako')
@checkRole('admin_ka')
def globalDelete(self, id, confirmed='0'):
@@ -149,10 +147,9 @@
if confirmed == 1:
try:
deleteDocument(id)
- except:
- traceback.print_exc(file=sys.stderr)
+ except Exception, e:
+ log.exception(e)
return self.globalOverview()
- #return render('/tests/trace.mako')
c.url_ok = h.url_for(controller="/document",
action="globalOverview")
c.success_for = SET_DOCUMENT_SUCCESS_DELETE_HEADER
More information about the Mpuls-commits
mailing list