comparison src/server/server.py @ 465:33ec27ef4b6a

server side: adapt passing the async failure from server to browser side, according to the new class BridgeException
author souliane <souliane@mailoo.org>
date Sun, 08 Jun 2014 16:59:48 +0200
parents bea9788f3170
children 34ce41e014c4
comparison
equal deleted inserted replaced
464:bea9788f3170 465:33ec27ef4b6a
156 if len(args) != 1: 156 if len(args) != 1:
157 Exception("Multiple return arguments not supported") 157 Exception("Multiple return arguments not supported")
158 d.callback(args[0]) 158 d.callback(args[0])
159 159
160 def _errback(result): 160 def _errback(result):
161 d.errback(Failure(jsonrpclib.Fault(C.ERRNUM_BRIDGE_ERRBACK, unicode(result)))) 161 d.errback(Failure(jsonrpclib.Fault(C.ERRNUM_BRIDGE_ERRBACK, result.classname)))
162 162
163 kwargs["callback"] = _callback 163 kwargs["callback"] = _callback
164 kwargs["errback"] = _errback 164 kwargs["errback"] = _errback
165 getattr(self.sat_host.bridge, method_name)(*args, **kwargs) 165 getattr(self.sat_host.bridge, method_name)(*args, **kwargs)
166 return d 166 return d