I'm trying to catch a connection error when connecting to kx using the clickhouse-driver db api in python. But for some reason, the try: block passes without errors, and I don't get exception
def __enter__(self):
try:
self.connector = db.connect(dsn=self.connection_string)
except Error as e: # pass
self.error = str(e)[:250]
self.connector = None
return self
And the error only happens when execute
sql is executed. Is there any way to get a connection error at the moment of connection?