summaryrefslogtreecommitdiff
path: root/qpid/python/commands/qpid-route
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/python/commands/qpid-route')
-rwxr-xr-xqpid/python/commands/qpid-route13
1 files changed, 10 insertions, 3 deletions
diff --git a/qpid/python/commands/qpid-route b/qpid/python/commands/qpid-route
index e839e36821..d87b5bd191 100755
--- a/qpid/python/commands/qpid-route
+++ b/qpid/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)