diff --git a/trytond/osv/osv.py b/trytond/osv/osv.py index a2c9eaaecd..6100e78975 100644 --- a/trytond/osv/osv.py +++ b/trytond/osv/osv.py @@ -46,9 +46,10 @@ class OSVService(Service): res = getattr(obj, method)(cursor, user, *args, **kargs) return res except Exception, exception: - if CONFIG['verbose'] or str(exception.args[0]) not in \ + if CONFIG['verbose'] or (exception.args \ + and str(exception.args[0]) not in \ ('NotLogged', 'ConcurrencyException', 'UserError', - 'UserWarning'): + 'UserWarning')): 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 43541b80cb..7b88d72411 100644 --- a/trytond/report/report.py +++ b/trytond/report/report.py @@ -56,9 +56,10 @@ class ReportService(Service): res = report.execute(cursor, user, ids, datas, context) return res except Exception, exception: - if CONFIG['verbose'] or str(exception.args[0]) not in \ + if CONFIG['verbose'] or (exception.args \ + and str(exception.args[0]) not in \ ('NotLogged', 'ConcurrencyException', 'UserError', - 'UserWarning'): + 'UserWarning')): 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 6dee6205d7..83256b1933 100644 --- a/trytond/wizard/wizard.py +++ b/trytond/wizard/wizard.py @@ -34,9 +34,10 @@ class WizardService(Service): res = wizard.execute(cursor, user, data, state, context) return res except Exception, exception: - if CONFIG['verbose'] or str(exception.args[0]) not in \ + if CONFIG['verbose'] or (exception.args \ + and str(exception.args[0]) not in \ ('NotLogged', 'ConcurrencyException', 'UserError', - 'UserWarning'): + 'UserWarning')): tb_s = reduce(lambda x, y: x+y, traceback.format_exception(*sys.exc_info())) logging.getLogger("web-service").error(