Remove abort_response function on Service

This commit is contained in:
Cédric Krier committed 2008-07-19 12:44:11 +02:00
1 parent adc8356be9
commit 3993e8e019
3 files changed
+4 -13

No files matched your search

-9
View File
@@ -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):
+3 -3
View File
@@ -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)
+1 -1
View File
@@ -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