From 470c2455ee01bb83cdb4a45cff8e2aa05bfeb019 Mon Sep 17 00:00:00 2001 From: "Gavin M. Roy" Date: Mon, 17 Feb 2014 15:04:36 -0500 Subject: [PATCH] Address issue #419 --- pika/exceptions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pika/exceptions.py b/pika/exceptions.py index 772e5bab9..bacf0e70e 100644 --- a/pika/exceptions.py +++ b/pika/exceptions.py @@ -58,7 +58,7 @@ def __repr__(self): self.args[1]) else: return 'The AMQP connection was closed' - + class AMQPChannelError(AMQPError): def __repr__(self): @@ -67,8 +67,11 @@ def __repr__(self): class ChannelClosed(AMQPChannelError): def __repr__(self): - return 'The channel was remotely closed (%s) %s' % (self.args[0], - self.args[1]) + if len(self.args) == 2: + return 'The channel was remotely closed (%s) %s' % (self.args[0], + self.args[1]) + else: + return 'The channel was remotely closed' class DuplicateConsumerTag(AMQPChannelError):