summaryrefslogtreecommitdiff
path: root/bin/tiny_socket.py
diff options
context:
space:
mode:
authorced <>2007-04-16 11:42:46 +0000
committerced <>2007-04-16 11:42:46 +0000
commit881fa804386f794e1f70ebd7b687103f56c4359f (patch)
treeca2cb51e70661e68a62555a87116415a8264edee /bin/tiny_socket.py
parent93bcf9f92da9eb5c59c4dc8edf0022b412390aee (diff)
CLIENT,SERVER: improve error message on client side
bzr revid: ced-6733fdd8bfd68743d3edaedf0d36da74287f11b8
Diffstat (limited to 'bin/tiny_socket.py')
-rw-r--r--bin/tiny_socket.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/tiny_socket.py b/bin/tiny_socket.py
index 545462d5c06..95c1296fc2f 100644
--- a/bin/tiny_socket.py
+++ b/bin/tiny_socket.py
@@ -23,8 +23,8 @@ class mysocket:
def disconnect(self):
self.sock.shutdown(socket.SHUT_RDWR)
self.sock.close()
- def mysend(self, msg, exception=False):
- msg = cPickle.dumps(msg)
+ def mysend(self, msg, exception=False, traceback=None):
+ msg = cPickle.dumps([msg,traceback])
size = len(msg)
self.sock.send('%8d' % size)
self.sock.send(exception and "1" or "0")
@@ -54,9 +54,10 @@ class mysocket:
raise RuntimeError, "socket connection broken"
msg = msg + chunk
res = cPickle.loads(msg)
- if isinstance(res,Exception):
+ if isinstance(res[0],Exception):
if exception:
- raise Myexception(exception, str(res))
- raise res
+ raise Myexception(exception, str(res[0]), str(res[1]))
+ raise res[0]
else:
- return res
+ return res[0]
+