Merge pull request #197 from Arcanemagus/print_raw_error_response

Print raw response when JSON fails to parse
This commit is contained in:
blacktwin 2019-10-28 09:28:07 -04:00 committed by GitHub
commit 0f8cbc77ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -268,7 +268,9 @@ class Tautulli:
try:
response_json = response.json()
except ValueError:
print("Failed to parse json response for Tautulli API cmd '{}'".format(cmd))
print(
"Failed to parse json response for Tautulli API cmd '{}': {}"
.format(cmd, response.content))
return
if response_json['response']['result'] == 'success':