mirror of
https://github.com/sprockets/sprockets.clients.dynamodb.git
synced 2024-11-23 11:19:54 +00:00
response can be None. Yay.
This commit is contained in:
parent
472684366f
commit
e4928b1cff
1 changed files with 8 additions and 5 deletions
|
@ -104,9 +104,10 @@ class DynamoDB(object):
|
||||||
if http_err.code == 599:
|
if http_err.code == 599:
|
||||||
future.set_exception(exceptions.TimeoutException())
|
future.set_exception(exceptions.TimeoutException())
|
||||||
else:
|
else:
|
||||||
|
response_reason = err.code
|
||||||
future.set_exception(
|
if err.response and hasattr(err.response, 'body'):
|
||||||
exceptions.RequestException(http_err.response.body))
|
response_reason = err.response.body
|
||||||
|
future.set_exception(response_reason)
|
||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
future.set_exception(exception)
|
future.set_exception(exception)
|
||||||
else:
|
else:
|
||||||
|
@ -127,8 +128,10 @@ class DynamoDB(object):
|
||||||
if err.code == 599:
|
if err.code == 599:
|
||||||
future.set_exception(exceptions.TimeoutException())
|
future.set_exception(exceptions.TimeoutException())
|
||||||
else:
|
else:
|
||||||
future.set_exception(
|
reason = err.code
|
||||||
exceptions.RequestException(err.response.body))
|
if err.response and hasattr(err.response, 'body'):
|
||||||
|
reason = err.response.body
|
||||||
|
future.set_exception(reason)
|
||||||
else:
|
else:
|
||||||
ioloop.IOLoop.current().add_future(aws_response, handle_response)
|
ioloop.IOLoop.current().add_future(aws_response, handle_response)
|
||||||
return future
|
return future
|
||||||
|
|
Loading…
Reference in a new issue