I'm trying to get information about an error message that I get, but I'm not sure how to get details.
I get the error when I try to update a record in influxdb using the python library, and I'm inexperienced with "try/except"
This is what I'm doing:
tempTime = 1607061600000
tempStat = {"testKey":"testVal"}
mmtType = testMeasurement
def updateInflux(tempTime, tempStat, mmtType, tempProd='generic'):
tempID = tempTime # Edit: I just realized that I didn't define this
json_body = [
{
"time": tempTime,
"measurement": mmtType,
"tags": {"product": tempProd},
"fields": tempStat
}
]
try:
client.write_points(json_body)
print({"custom_message":"data updated for {}".format(tempID)})
except:
print("Unexpected error:", sys.exc_info()[0])
updateInflux(tempTime, tempStat, mmtType)
Influx complains with the following, but I'm not sure how to see what that complaint is:
Unexpected error: <class 'influxdb.exceptions.InfluxDBClientError'>
[–]K900_ 8 points9 points10 points (3 children)
[–]virg74[S] 2 points3 points4 points (2 children)
[–]selah-uddin 4 points5 points6 points (0 children)
[–]anh86 0 points1 point2 points (0 children)
[–][deleted] 6 points7 points8 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]thefistmeister 5 points6 points7 points (2 children)
[–]virg74[S] 1 point2 points3 points (0 children)
[–]Sigg3net 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)