@@ -153,6 +153,7 @@ def _classify_error(
153153 error: Exception,
154154 context: InterceptorContext[Input, Output, $1T, $2T | None]
155155 ) -> RetryErrorInfo:
156+ logger.debug("Classifying error: %s", error)
156157 """ , transportRequest , transportResponse );
157158 writer .indent ();
158159
@@ -229,7 +230,7 @@ async def _handle_execution(
229230 event_response_deserializer: DeserializeableShape | None = None,
230231 ${/hasEventStream}
231232 ) -> Output:
232- logger.debug(f" Making request for operation {operation_name} with parameters: { input}" )
233+ logger.debug(' Making request for operation "%s" with parameters: %s', operation_name, input)
233234 context: InterceptorContext[Input, None, None, None] = InterceptorContext(
234235 request=input,
235236 response=None,
@@ -276,9 +277,11 @@ async def _handle_execution(
276277 context_with_transport_request = cast(
277278 InterceptorContext[Input, None, $2T, None], context
278279 )
280+ logger.debug("Serializing request for: %s", context_with_transport_request.request)
279281 context_with_transport_request._transport_request = await serialize(
280282 context_with_transport_request.request, config
281283 )
284+ logger.debug("Serialization complete. Transport request: %s", context_with_transport_request._transport_request)
282285
283286 # Step 5: Invoke read_after_serialization
284287 for interceptor in interceptors:
@@ -326,6 +329,11 @@ async def _handle_execution(
326329 )
327330 except SmithyRetryException:
328331 raise context_with_response.response
332+ logger.debug(
333+ "Retry needed. Attempting request #%s in %.4f seconds.",
334+ retry_token.retry_count + 1,
335+ retry_token.retry_delay
336+ )
329337 await sleep(retry_token.retry_delay)
330338 current_body = context_with_transport_request.transport_request.body
331339 if (seek := getattr(current_body, "seek", None)) is not None:
@@ -336,7 +344,7 @@ await seek(0)
336344 break
337345 except Exception as e:
338346 if context.response is not None:
339- logger.exception(f "Exception occurred while handling: { context.response}" )
347+ logger.exception("Exception occurred while handling: %s", context.response)
340348 pass
341349 context._response = e
342350
@@ -443,10 +451,12 @@ async def _handle_attempt(
443451 raise $1T(
444452 "No endpoint_uri found on the operation config."
445453 )
446-
454+ endpoint_resolver_parameters = StaticEndpointParams(uri=config.endpoint_uri)
455+ logger.debug("Calling endpoint resolver with parameters: %s", endpoint_resolver_parameters)
447456 endpoint = await config.endpoint_resolver.resolve_endpoint(
448- StaticEndpointParams(uri=config.endpoint_uri)
457+ endpoint_resolver_parameters
449458 )
459+ logger.debug("Endpoint resolver result: %s", endpoint)
450460 if not endpoint.uri.path:
451461 path = ""
452462 elif endpoint.uri.path.endswith("/"):
@@ -484,11 +494,17 @@ async def _handle_attempt(
484494 writer .write ("""
485495 # Step 7i: sign the request
486496 if auth_option and signer:
497+ logger.debug("HTTP request to sign: %s", context.transport_request)
498+ logger.debug(
499+ "Signer properties: %s",
500+ auth_option.signer_properties
501+ )
487502 context._transport_request = await signer.sign(
488503 http_request=context.transport_request,
489504 identity=identity,
490505 signing_properties=auth_option.signer_properties,
491506 )
507+ logger.debug("Signed HTTP request: %s", context._transport_request)
492508 """ );
493509 }
494510 writer .popState ();
@@ -518,10 +534,13 @@ async def _handle_attempt(
518534 context_with_response = cast(
519535 InterceptorContext[Input, None, $1T, $2T], context
520536 )
537+ logger.debug("HTTP request config: %s", request_config)
538+ logger.debug("Sending HTTP request: %s", context_with_response.transport_request)
521539 context_with_response._transport_response = await config.http_client.send(
522540 request=context_with_response.transport_request,
523541 request_config=request_config,
524542 )
543+ logger.debug("Received HTTP response: %s", context_with_response.transport_response)
525544
526545 """ , transportRequest , transportResponse );
527546 }
@@ -547,16 +566,18 @@ async def _handle_attempt(
547566 InterceptorContext[Input, Output, $1T, $2T],
548567 context_with_response,
549568 )
569+ logger.debug("Deserializing transport response: %s", context_with_output._transport_response)
550570 context_with_output._response = await deserialize(
551571 context_with_output._transport_response, config
552572 )
573+ logger.debug("Deserialization complete. Response: %s", context_with_output._response)
553574
554575 # Step 7r: Invoke read_after_deserialization
555576 for interceptor in interceptors:
556577 interceptor.read_after_deserialization(context_with_output)
557578 except Exception as e:
558579 if context.response is not None:
559- logger.exception(f "Exception occurred while handling: { context.response}" )
580+ logger.exception("Exception occurred while handling: %s", context.response)
560581 pass
561582 context._response = e
562583
@@ -582,7 +603,7 @@ async def _finalize_attempt(
582603 )
583604 except Exception as e:
584605 if context.response is not None:
585- logger.exception(f "Exception occurred while handling: { context.response}" )
606+ logger.exception("Exception occurred while handling: %s", context.response)
586607 pass
587608 context._response = e
588609
@@ -592,7 +613,7 @@ async def _finalize_attempt(
592613 interceptor.read_after_attempt(context)
593614 except Exception as e:
594615 if context.response is not None:
595- logger.exception(f "Exception occurred while handling: { context.response}" )
616+ logger.exception("Exception occurred while handling: %s", context.response)
596617 pass
597618 context._response = e
598619
@@ -613,11 +634,11 @@ async def _finalize_execution(
613634 pass
614635 except Exception as e:
615636 # log and ignore exceptions
616- logger.exception(f "Exception occurred while dispatching trace events: {e}" )
637+ logger.exception("Exception occurred while dispatching trace events: %s", e )
617638 pass
618639 except Exception as e:
619640 if context.response is not None:
620- logger.exception(f "Exception occurred while handling: { context.response}" )
641+ logger.exception("Exception occurred while handling: %s", context.response)
621642 pass
622643 context._response = e
623644
@@ -627,7 +648,7 @@ async def _finalize_execution(
627648 interceptor.read_after_execution(context)
628649 except Exception as e:
629650 if context.response is not None:
630- logger.exception(f "Exception occurred while handling: { context.response}" )
651+ logger.exception("Exception occurred while handling: %s", context.response)
631652 pass
632653 context._response = e
633654
0 commit comments