2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-26 03:38:25 +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) k, exc_info=True)
else: else:
if response.status not in (200, 204): if response.status not in (200, 204):
logger.warning("got HTTP status %d trying to update '%s'", content = (yield from response.content.read()).decode()
response.status, k) if content:
content = content[:-1] # drop \n
logger.warning("got HTTP status %d "
"trying to update '%s': %s",
response.status, k, content)
response.close() response.close()