forked from M-Labs/artiq
1
0
Fork 0

influxdb: better error reporting

This commit is contained in:
Sebastien Bourdeauducq 2015-08-18 13:34:15 +08:00
parent ed0a7632d9
commit 2275017651
1 changed files with 6 additions and 2 deletions

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()