From 2055e495e78b8ce8b36d5883425a119a6753c97f Mon Sep 17 00:00:00 2001 From: Dan LaMotte Date: Thu, 11 Apr 2013 13:05:50 -0500 Subject: [PATCH] Change exception to something subclassed from KombuError --- kombu/connection.py | 4 +++- kombu/exceptions.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) 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