1414
1515import botocore .client
1616import botocore .exceptions
17- from botocore .awsrequest import AWSPreparedRequest , create_request_object
17+ from botocore .awsrequest import AWSPreparedRequest , create_request_object , AWSResponse
1818from botocore .client import ClientError
1919from botocore .hooks import first_non_none_response
2020from botocore .exceptions import BotoCoreError
@@ -380,9 +380,11 @@ def _make_api_call(self, operation_name: str, operation_kwargs: Dict, settings:
380380 'has_streaming_input' : operation_model .has_streaming_input ,
381381 'auth_type' : operation_model .auth_type ,
382382 }
383- endpoint_url , additional_headers = self .client ._resolve_endpoint_ruleset (
383+ endpoint_url , additional_headers , * rest = self .client ._resolve_endpoint_ruleset (
384384 operation_model , operation_kwargs , request_context
385385 )
386+ if rest and rest [0 ]:
387+ request_context ['endpoint_properties' ] = rest [0 ]
386388 request_dict = self .client ._convert_to_request_dict (
387389 api_params = operation_kwargs ,
388390 operation_model = operation_model ,
@@ -400,7 +402,6 @@ def _make_api_call(self, operation_name: str, operation_kwargs: Dict, settings:
400402 attempt_number = i + 1
401403 is_last_attempt_for_exceptions = i == self ._max_retry_attempts_exception
402404
403- http_response = None
404405 prepared_request = None
405406 try :
406407 if prepared_request is not None :
@@ -432,8 +433,6 @@ def _make_api_call(self, operation_name: str, operation_kwargs: Dict, settings:
432433 except (ValueError , botocore .exceptions .HTTPClientError , botocore .exceptions .ConnectionError ) as e :
433434 if is_last_attempt_for_exceptions :
434435 log .debug ('Reached the maximum number of retry attempts: %s' , attempt_number )
435- if http_response :
436- e .args += (http_response .text ,)
437436 raise
438437 else :
439438 # No backoff for fast-fail exceptions that likely failed at the frontend
0 commit comments