From ea3eadaf0f332988da797cc66d6534dc2ee4ee1e Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Tue, 1 Jul 2014 14:09:05 +0000 Subject: [QPID-5864]: [Python client] Provide better error description when SASL required but no credentials provided git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1607086 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/qpid/messaging/driver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qpid/python') diff --git a/qpid/python/qpid/messaging/driver.py b/qpid/python/qpid/messaging/driver.py index 2e27fdb421..e8ab964f0e 100644 --- a/qpid/python/qpid/messaging/driver.py +++ b/qpid/python/qpid/messaging/driver.py @@ -723,7 +723,11 @@ class Engine: try: mech, initial = self._sasl.start(" ".join(mechs)) except sasl.SASLError, e: - raise AuthenticationFailure(text=str(e)) + if "ANONYMOUS" not in mechs and self.connection.username is None: + _text="Anonymous connections disabled, missing credentials" + else: + _text=str(e) + raise AuthenticationFailure(text=_text) client_properties = get_client_properties_with_defaults(provided_client_properties=self.connection.client_properties); self.write_op(ConnectionStartOk(client_properties=client_properties, -- cgit v1.2.1