changeset 819:1ed10c3ce40c

Trap ConnectionDone "errors", raise other errors.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 12 Jul 2008 16:12:17 +0200
parents 3543e266d88a
children facc9f1f0bb1
files viff/runtime.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/viff/runtime.py	Sat Jul 12 15:58:56 2008 +0200
+++ b/viff/runtime.py	Sat Jul 12 16:12:17 2008 +0200
@@ -45,6 +45,7 @@
 from viff.util import wrapper, rand
 
 from twisted.internet import reactor
+from twisted.internet.error import ConnectionDone
 from twisted.internet.defer import Deferred, DeferredList, gatherResults, succeed
 from twisted.internet.protocol import ClientFactory, ServerFactory
 from twisted.protocols.basic import Int16StringReceiver
@@ -262,7 +263,7 @@
             self.peer_cert = None
 
     def connectionLost(self, reason):
-        print "Connection lost:", reason
+        reason.trap(ConnectionDone)
 
     def stringReceived(self, string):
         """Called when a share is received.
@@ -336,7 +337,7 @@
             self.protocols_ready.callback(self.runtime)
 
     def clientConnectionLost(self, connector, reason):
-        print "Client connection lost:", reason
+        reason.trap(ConnectionDone)
 
     def clientConnectionFailed(self, connector, reason):
         print "Client connection failed:", reason