From bb2722ed6420517284e8734177eca2f9441aa375 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Sat, 3 Oct 2009 12:00:03 +0300 Subject: [PATCH] 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 --- bin/netsvc.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/netsvc.py b/bin/netsvc.py index c45ed5c5d65..91e9c127b5a 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -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))