Log HTTP 400 json payloads

This commit is contained in:
Odd Stråbø 2020-11-23 03:21:01 +01:00
parent a7e4fa8a5c
commit 6c3b682ef0
1 changed files with 8 additions and 0 deletions

View File

@ -135,6 +135,14 @@ class HTTP(object):
raise HTTPException("Unauthorized", error) raise HTTPException("Unauthorized", error)
elif r.status_code == 400:
LOG.warning(error)
LOG.warning(data)
try:
LOG.warning(r.json())
except Exception:
pass
elif r.status_code == 500: # log and ignore. elif r.status_code == 500: # log and ignore.
LOG.error("--[ 500 response ] %s", error) LOG.error("--[ 500 response ] %s", error)