Change exception to something subclassed from KombuError

This commit is contained in:
Dan LaMotte 2013-04-11 13:05:50 -05:00 committed by Ask Solem
parent 68075277dc
commit 2055e495e7
2 changed files with 5 additions and 1 deletions

View File

@ -110,6 +110,8 @@ class Connection(object):
>>> conn.release()
"""
SSLNotSupported = exceptions.SSLNotSupported
port = None
virtual_host = '/'
connect_timeout = 5
@ -234,7 +236,7 @@ class Connection(object):
self.heartbeat = heartbeat and float(heartbeat)
if ssl and transport == 'librabbitmq':
raise Exception('SSL not supported for "librabbitmq" transport')
raise self.SSLNotSupported(transport)
def _debug(self, msg, *args, **kwargs):
fmt = '[Kombu connection:0x%(id)x] %(msg)s'

View File

@ -45,6 +45,8 @@ class ChannelLimitExceeded(LimitExceeded):
"""Maximum number of simultaneous channels exceeded."""
pass
class SSLNotSupported(KombuError):
pass
class StdConnectionError(KombuError):
pass