From 0eb9fb48839ad45e41bd54a019baedcf83227607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 27 Nov 2008 15:49:01 +0100 Subject: [PATCH] Log exception that are not 'UserError', 'ConcurrencyException' nor 'NotLogged' --- trytond/osv/osv.py | 3 ++- trytond/report/report.py | 3 ++- trytond/wizard/wizard.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/trytond/osv/osv.py b/trytond/osv/osv.py index 11035c800e..2f85a0c4e4 100644 --- a/trytond/osv/osv.py +++ b/trytond/osv/osv.py @@ -46,7 +46,8 @@ class OSVService(Service): res = getattr(obj, method)(cursor, user, *args, **kargs) return res except Exception, exception: - if CONFIG['verbose']: + if CONFIG['verbose'] or str(exception.args[0]) not in \ + ('NotLogged', 'ConcurrencyException', 'UserError'): tb_s = reduce(lambda x, y: x+y, traceback.format_exception(*sys.exc_info())) logger = logging.getLogger("web-service") diff --git a/trytond/report/report.py b/trytond/report/report.py index b32b8c1d16..667444cd28 100644 --- a/trytond/report/report.py +++ b/trytond/report/report.py @@ -56,7 +56,8 @@ class ReportService(Service): res = report.execute(cursor, user, ids, datas, context) return res except Exception, exception: - if CONFIG['verbose']: + if CONFIG['verbose'] or str(exception.args[0]) not in \ + ('NotLogged', 'ConcurrencyException', 'UserError'): tb_s = reduce(lambda x, y: x+y, traceback.format_exception(*sys.exc_info())) logging.getLogger("web-service").error( diff --git a/trytond/wizard/wizard.py b/trytond/wizard/wizard.py index 2c09d886d0..e003ba4db0 100644 --- a/trytond/wizard/wizard.py +++ b/trytond/wizard/wizard.py @@ -34,7 +34,8 @@ class WizardService(Service): res = wizard.execute(cursor, user, data, state, context) return res except Exception, exception: - if CONFIG['verbose']: + if CONFIG['verbose'] or str(exception.args[0]) not in \ + ('NotLogged', 'ConcurrencyException', 'UserError'): tb_s = reduce(lambda x, y: x+y, traceback.format_exception(*sys.exc_info())) logging.getLogger("web-service").error(