Merge "Gracefully handle consumer cancel notifications"

This commit is contained in:
Jenkins 2014-03-04 04:33:24 +00:00 committed by Gerrit Code Review
commit 5594a57012
1 changed files with 4 additions and 0 deletions

View File

@ -514,6 +514,7 @@ class Connection(object):
self.connection = None
self.connection = kombu.connection.BrokerConnection(**params)
self.connection_errors = self.connection.connection_errors
self.channel_errors = self.connection.channel_errors
if self.memory_transport:
# Kludge to speed up tests.
self.connection.transport.polling_interval = 0.0
@ -591,6 +592,9 @@ class Connection(object):
except self.connection_errors as e:
if error_callback:
error_callback(e)
except self.channel_errors as e:
if error_callback:
error_callback(e)
except (socket.timeout, IOError) as e:
if error_callback:
error_callback(e)