From 7b9e370d29da677d70dd98e3c254ac71a3b0b8ab Mon Sep 17 00:00:00 2001 From: "Carl C. Trieloff" Date: Fri, 16 May 2008 14:02:57 +0000 Subject: QPID-1067 by tross git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@657069 13f79535-47bb-0310-9956-ffa450edef68 --- python/commands/qpid-route | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'python/commands/qpid-route') diff --git a/python/commands/qpid-route b/python/commands/qpid-route index e839e36821..d87b5bd191 100755 --- a/python/commands/qpid-route +++ b/python/commands/qpid-route @@ -27,7 +27,7 @@ import os from qpid.management import managementClient from qpid.managementdata import Broker from qpid.peer import Closed -from qpid.connection import Connection +from qpid.connection import Connection, ConnectionFailed from qpid.util import connect def Usage (): @@ -70,14 +70,21 @@ class RouteManager: try: self.spec = qpid.spec.load (_specpath) self.sessionId = "%s.%d" % (os.uname()[1], os.getpid()) - self.conn = Connection (connect (broker.host, broker.port), self.spec, username=broker.username, password=broker.password) + self.conn = Connection (connect (broker.host, broker.port), self.spec, \ + username=broker.username, password=broker.password) self.conn.start () self.mclient = managementClient (self.spec) self.mch = self.mclient.addChannel (self.conn.session(self.sessionId)) self.mclient.syncWaitForStable (self.mch) except socket.error, e: - print "Connect Error:", e + print "Socket Error %s - %s" % (e[0], e[1]) sys.exit (1) + except Closed, e: + print "Connect Failed %d - %s" % (e[0], e[1]) + sys.exit (1) + except ConnectionFailed, e: + print "Connect Failed %d - %s" % (e[0], e[1]) + sys.exit(1) def Disconnect (self): self.mclient.removeChannel (self.mch) -- cgit v1.2.1