]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - xmlrpcclient.py
fix bug in pong handler
[quix0rs-apt-p2p.git] / xmlrpcclient.py
index 230f3ad56762169eae6caa1f2955201fd22d4e70..5c8f3cf2565329cc235cf9f598e296c86eb3abd4 100644 (file)
@@ -17,9 +17,13 @@ class XMLRPCClient(HTTPClient):
         self.transport.write('\r\n')
        
     def handleResponse(self, buf):
-       args, name = loads(buf)
-       apply(self.d.callback, args)
-
+       try:
+           args, name = loads(buf)
+       except Exception, e:
+           print "response decode error: " + `e`
+           self.d.errback()
+       else:
+           apply(self.d.callback, args)
 
 class XMLRPCClientFactory(ClientFactory):
     def __init__(self, method, args, callback=None, errback=None):