mirror of
https://github.com/sprockets/sprockets.clients.dynamodb.git
synced 2024-11-23 11:19:54 +00:00
Actually raise an exception
This commit is contained in:
parent
69888b6b71
commit
5219e025e9
1 changed files with 6 additions and 4 deletions
|
@ -104,11 +104,12 @@ class DynamoDB(object):
|
|||
if http_err.code == 599:
|
||||
future.set_exception(exceptions.TimeoutException())
|
||||
else:
|
||||
response_reason = http_err.code
|
||||
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(response_reason)
|
||||
future.set_exception(
|
||||
exceptions.RequestException(response_reason))
|
||||
except Exception as exception:
|
||||
future.set_exception(exception)
|
||||
else:
|
||||
|
@ -129,10 +130,11 @@ class DynamoDB(object):
|
|||
if err.code == 599:
|
||||
future.set_exception(exceptions.TimeoutException())
|
||||
else:
|
||||
reason = err.code
|
||||
reason = str(err.code)
|
||||
if err.response and hasattr(err.response, 'body'):
|
||||
reason = err.response.body
|
||||
future.set_exception(reason)
|
||||
future.set_exception(exceptions.RequestException(reason))
|
||||
|
||||
else:
|
||||
ioloop.IOLoop.current().add_future(aws_response, handle_response)
|
||||
return future
|
||||
|
|
Loading…
Reference in a new issue