From 907d25164fec560044a69dbe7e08130c2948a05a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 28 Mar 2019 11:03:33 -0400 Subject: [PATCH] Replace the network error with a local error This is a bit more clear about the cause when local commands fail. --- 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 b79d865a..a9a63d7b 100644 --- a/confluent_client/confluent/client.py +++ b/confluent_client/confluent/client.py @@ -136,6 +136,8 @@ class Command(object): self.serverloc = server if os.path.isabs(self.serverloc) and os.path.exists(self.serverloc): self._connect_unix() + elif self.serverloc == '/var/run/confluent/api.sock': + raise Exception('Confluent service is not available') else: self._connect_tls() tlvdata.recv(self.connection)