Currently I am saving data to QuestDB through Python via the Influx Line Protocol (ILP) like so:
import socket
ilp_msg = 'my_table,name=server_timestamp value=12.4\n'
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((HOST, PORT))
sock.send((ilp_msg).encode())
except socket.error as e:
raise ValueError(f'Got error: {e}')
sock.close()
If there is something wrong with my ilp_msg
or the server or the DB, the above code will execute without raising any error. It will log into sdr out (or std err) on the DB.
My question: how can I save data to QuestDB via python and capture any error messages, so that I know that my save method has failed for a particular row.