#NEWLINE# def _finish_make_request( self , response , callback , orig_request , token_used , object_hook = None ) : #NEWLINE# #INDENT# 'Check for errors and decode the json response (in the tornado\n    response body), then pass on to orig callback.  This method also\n    contains some of the logic to handle reacquiring session tokens.\n    ' #NEWLINE# if ( not response . body ) : #NEWLINE# #INDENT# assert response . error , ( 'How can there be no response body and no error? Response: %s' % response ) #NEWLINE# raise DynamoDBResponseError ( response . error . code , response . error . message , None ) #NEWLINE# #UNINDENT# json_response = json . loads ( response . body , object_hook = object_hook ) #NEWLINE# if response . error : #NEWLINE# #INDENT# aws_error_type = None #NEWLINE# try : #NEWLINE# #INDENT# aws_error_type = json_response . get ( '__type' ) . split ( '#' ) [ 1 ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# aws_error_type = None #NEWLINE# #UNINDENT# if ( ( aws_error_type == self . ExpiredSessionError ) or ( aws_error_type == self . UnrecognizedClientException ) ) : #NEWLINE# #INDENT# if ( self . provider . security_token == token_used ) : #NEWLINE# #INDENT# self . provider . security_token = None #NEWLINE# #UNINDENT# return orig_request ( ) #NEWLINE# #UNINDENT# if ( aws_error_type == AsyncDynamoDB . ProvisionedThroughputExceededException ) : #NEWLINE# #INDENT# raise DBProvisioningExceededError ( json_response [ 'message' ] ) #NEWLINE# #UNINDENT# if ( aws_error_type == AsyncDynamoDB . LimitExceededException ) : #NEWLINE# #INDENT# raise DBLimitExceededError ( json_response [ 'message' ] ) #NEWLINE# #UNINDENT# if ( aws_error_type == AsyncDynamoDB . ConditionalCheckFailedException ) : #NEWLINE# #INDENT# raise DBConditionalCheckFailedError ( json_response [ 'message' ] ) #NEWLINE# #UNINDENT# raise DynamoDBResponseError ( response . error . code , response . error . message , json_response ) #NEWLINE# #UNINDENT# return callback ( json_response )