mirror of
https://github.com/sprockets/sprockets.clients.dynamodb.git
synced 2024-11-23 11:19:54 +00:00
Merge pull request #4 from sprockets/fix-httperror
HTTPError.message is not a thing
This commit is contained in:
commit
9c8ce88169
2 changed files with 11 additions and 3 deletions
|
@ -4,7 +4,7 @@ except ImportError as error:
|
|||
def DynamoDB(*args, **kwargs):
|
||||
raise error
|
||||
|
||||
version_info = (0, 2, 0)
|
||||
version_info = (0, 2, 1)
|
||||
__version__ = '.'.join(str(v) for v in version_info)
|
||||
|
||||
# Response constants
|
||||
|
|
|
@ -104,8 +104,12 @@ class DynamoDB(object):
|
|||
if http_err.code == 599:
|
||||
future.set_exception(exceptions.TimeoutException())
|
||||
else:
|
||||
response_reason = str(http_err.code)
|
||||
if http_err.response and \
|
||||
hasattr(http_err.response, 'body'):
|
||||
response_reason = http_err.response.body
|
||||
future.set_exception(
|
||||
exceptions.RequestException(http_err.message))
|
||||
exceptions.RequestException(response_reason))
|
||||
except Exception as exception:
|
||||
future.set_exception(exception)
|
||||
else:
|
||||
|
@ -126,7 +130,11 @@ class DynamoDB(object):
|
|||
if err.code == 599:
|
||||
future.set_exception(exceptions.TimeoutException())
|
||||
else:
|
||||
future.set_exception(exceptions.RequestException(err.message))
|
||||
reason = str(err.code)
|
||||
if err.response and hasattr(err.response, 'body'):
|
||||
reason = err.response.body
|
||||
future.set_exception(exceptions.RequestException(reason))
|
||||
|
||||
else:
|
||||
ioloop.IOLoop.current().add_future(aws_response, handle_response)
|
||||
return future
|
||||
|
|
Loading…
Reference in a new issue