From 3993e8e01921356a021c7fa2ef73995c4257360b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 19 Jul 2008 12:44:11 +0200 Subject: [PATCH] Remove abort_response function on Service --- trytond/netsvc.py | 9 --------- trytond/osv/osv.py | 6 +++--- trytond/wizard/wizard.py | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/trytond/netsvc.py b/trytond/netsvc.py index e4d511f51d..f9264aaf66 100644 --- a/trytond/netsvc.py +++ b/trytond/netsvc.py @@ -53,15 +53,6 @@ class Service(object): if callable(method): self.method[method.__name__] = method - def abort_response(self, description, origin, details): - if CONFIG['verbose']: - tb_s = reduce(lambda x, y: x+y, - traceback.format_exception(*sys.exc_info())) - logger = Logger() - logger.notify_channel("web-services", LOG_ERROR, - 'Exception in call: \n' + tb_s) - raise Exception("%s -- %s\n\n%s" % (origin, description, details)) - class LocalService(Service): diff --git a/trytond/osv/osv.py b/trytond/osv/osv.py index 4de6bc18e8..a3ff90c8b6 100644 --- a/trytond/osv/osv.py +++ b/trytond/osv/osv.py @@ -36,10 +36,10 @@ class OSVService(Service): try: obj = pooler.get_pool(cursor.dbname).get(object_name) if not obj: - self.abort_response('Object Error', 'warning', - 'Object %s doesn\'t exist' % str(object_name)) + raise Exception('Error', + 'Object %s doesn\'t exist' % str(object_name)) if method not in obj._rpc_allowed: - self.abort_response('Object Error', 'warning', + raise Exception('Error', 'Calling method %s on object %s is not allowed' \ % (method, object_name)) res = getattr(obj, method)(cursor, user, *args, **kargs) diff --git a/trytond/wizard/wizard.py b/trytond/wizard/wizard.py index 5672f3b12e..1578e217d4 100644 --- a/trytond/wizard/wizard.py +++ b/trytond/wizard/wizard.py @@ -27,7 +27,7 @@ class WizardService(Service): try: wizard = pooler.get_pool_wizard(cursor.dbname).get(wizard_name) if not wizard: - self.abort_response('Wizard Error', 'warning', + raise Exception('Error', 'Wizard %s doesn\'t exist' % str(wizard_name)) res = wizard.execute(cursor, user, data, state, context) return res