Skip to content
Snippets Groups Projects
Commit 2ed2a806 authored by Gavin M. Roy's avatar Gavin M. Roy
Browse files

Log JSONDecodeErrors

parent ab862e16
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3,6 +3,10 @@
Version History
===============
 
0.7.1 (2017-06-02)
------------------
- Getting error response back that we can't decode, log it
0.7.0 (2017-06-02)
------------------
- Don't overwrite the ``Host`` HTTP header if it's set
Loading
Loading
Loading
Loading
@@ -39,7 +39,7 @@ def read_requirements(name):
 
setuptools.setup(
name='tornado-aws',
version='0.7.0',
version='0.7.1',
description=DESC,
long_description=open('README.rst').read(),
author='Gavin M. Roy',
Loading
Loading
Loading
Loading
@@ -6,6 +6,6 @@ from tornado_aws.client import AWSClient
from tornado_aws.client import AsyncAWSClient
from tornado_aws.client import exceptions
 
__version__ = '0.7.0'
__version__ = '0.7.1'
 
__all__ = ['AWSClient', 'AsyncAWSClient', 'exceptions']
Loading
Loading
@@ -184,7 +184,12 @@ class AWSClient(object):
if not isinstance(error, httpclient.HTTPError):
return
if error.code == 400:
payload = json.loads(error.response.body.decode('utf-8'))
try:
payload = json.loads(error.response.body.decode('utf-8'))
except json.JSONDecodeError as error:
LOGGER.error('Error decoding response: %r [%r]',
error.response, error.response.body)
return
if isinstance(payload, dict) and '__type' in payload:
return payload
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment