Welcome to the community.
Please provide more information.
What is the error message exactly?
Which InfluxDB database version (1.x.x or 2.x.x) are you writing to?
Please show us some more coherent real code. The code shown can’t work at all as client is declared later?
Sorry, I edited the code. This is the real code and it works. I can try to write bad data and then I can put a breakpoint inside the package in this function: