14
14
15
15
import botocore .client
16
16
import botocore .exceptions
17
- from botocore .awsrequest import AWSPreparedRequest , create_request_object
17
+ from botocore .awsrequest import AWSPreparedRequest , create_request_object , AWSResponse
18
18
from botocore .client import ClientError
19
19
from botocore .hooks import first_non_none_response
20
20
from botocore .exceptions import BotoCoreError
@@ -380,9 +380,11 @@ def _make_api_call(self, operation_name: str, operation_kwargs: Dict, settings:
380
380
'has_streaming_input' : operation_model .has_streaming_input ,
381
381
'auth_type' : operation_model .auth_type ,
382
382
}
383
- endpoint_url , additional_headers = self .client ._resolve_endpoint_ruleset (
383
+ endpoint_url , additional_headers , * rest = self .client ._resolve_endpoint_ruleset (
384
384
operation_model , operation_kwargs , request_context
385
385
)
386
+ if rest and rest [0 ]:
387
+ request_context ['endpoint_properties' ] = rest [0 ]
386
388
request_dict = self .client ._convert_to_request_dict (
387
389
api_params = operation_kwargs ,
388
390
operation_model = operation_model ,
@@ -400,7 +402,6 @@ def _make_api_call(self, operation_name: str, operation_kwargs: Dict, settings:
400
402
attempt_number = i + 1
401
403
is_last_attempt_for_exceptions = i == self ._max_retry_attempts_exception
402
404
403
- http_response = None
404
405
prepared_request = None
405
406
try :
406
407
if prepared_request is not None :
@@ -432,8 +433,6 @@ def _make_api_call(self, operation_name: str, operation_kwargs: Dict, settings:
432
433
except (ValueError , botocore .exceptions .HTTPClientError , botocore .exceptions .ConnectionError ) as e :
433
434
if is_last_attempt_for_exceptions :
434
435
log .debug ('Reached the maximum number of retry attempts: %s' , attempt_number )
435
- if http_response :
436
- e .args += (http_response .text ,)
437
436
raise
438
437
else :
439
438
# No backoff for fast-fail exceptions that likely failed at the frontend
0 commit comments