2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

influxdb: better error reporting

This commit is contained in:
Sebastien Bourdeauducq 2015-08-18 13:34:15 +08:00
parent ed0a7632d9
commit 2275017651

View File

@ -91,8 +91,12 @@ class DBWriter(TaskObject):
k, exc_info=True)
else:
if response.status not in (200, 204):
logger.warning("got HTTP status %d trying to update '%s'",
response.status, k)
content = (yield from response.content.read()).decode()
if content:
content = content[:-1] # drop \n
logger.warning("got HTTP status %d "
"trying to update '%s': %s",
response.status, k, content)
response.close()