From a2445e7f6514b5e316914c2a7e4b5f0a31731229 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 28 Jan 2016 10:26:28 -0500 Subject: [PATCH] Have client exit on auth issue Without this, an auth error will leave client just hanging without any feedback. Correct this with raising an exception for now. --- confluent_client/confluent/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_client/confluent/client.py b/confluent_client/confluent/client.py index 506dc4aa..a69560f3 100644 --- a/confluent_client/confluent/client.py +++ b/confluent_client/confluent/client.py @@ -208,6 +208,8 @@ def send_request(operation, path, server, parameters=None): :param server: The socket to send data over :param parameters: Parameters if any to send along with the request """ + if not self.authenticated: + raise Exception('Unauthenticated') payload = {'operation': operation, 'path': path} if parameters is not None: payload['parameters'] = parameters