New API: work better for bad ExportServices.

Using the partially ported koo/subscription service, discovered that
'None' would be returned, which leads to an exception.

bzr revid: p_christ@hol.gr-20091003090003-z9m8yyp08vxnor0s
This commit is contained in:
P. Christeas 2009-10-03 12:00:03 +03:00
parent e384a2da40
commit bb2722ed64
1 changed files with 6 additions and 3 deletions

View File

@ -109,10 +109,10 @@ class ExportService(object):
return cls._services[name]
def dispatch(self, method, auth, params):
pass
raise Exception("stub dispatch at %s" % self.__name)
def new_dispatch(self,method,auth,params):
pass
raise Exception("stub dispatch at %s" % self.__name)
def abortResponse(self, error, description, origin, details):
if not tools.config['debug_mode']:
@ -354,6 +354,9 @@ class OpenERPDispatcher:
auth = None
result = ExportService.getService(service_name).dispatch(method, auth, params)
self.log('result', result)
# We shouldn't marshall None,
if result == None:
result = False
return result
except Exception, e:
self.log('exception', tools.exception_to_unicode(e))