diff --git a/kombu/connection.py b/kombu/connection.py index b3d0c43d..df284762 100644 --- a/kombu/connection.py +++ b/kombu/connection.py @@ -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' diff --git a/kombu/exceptions.py b/kombu/exceptions.py index 32261506..a81db17c 100644 --- a/kombu/exceptions.py +++ b/kombu/exceptions.py @@ -45,6 +45,8 @@ class ChannelLimitExceeded(LimitExceeded): """Maximum number of simultaneous channels exceeded.""" pass +class SSLNotSupported(KombuError): + pass class StdConnectionError(KombuError): pass