Fix request ID logging for streaming operations (#2495)

This commit is contained in:
John DiSanti 2023-03-27 14:34:38 -07:00 committed by GitHub
parent c76e73a702
commit b65a645ce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -22,3 +22,15 @@ message = "The outputs for event stream operations now implement the `Sync` auto
references = ["smithy-rs#2496"]
meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "all"}
author = "jdisanti"
[[aws-sdk-rust]]
message = "Streaming operations now emit the request ID at the `debug` log level like their non-streaming counterparts."
references = ["smithy-rs#2495"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "jdisanti"
[[smithy-rs]]
message = "Streaming operations now emit the request ID at the `debug` log level like their non-streaming counterparts."
references = ["smithy-rs#2495"]
meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "client"}
author = "jdisanti"

View File

@ -145,6 +145,7 @@ class HttpBoundProtocolTraitImplGenerator(
impl #{ParseResponse} for $operationName {
type Output = std::result::Result<#{O}, #{E}>;
fn parse_unloaded(&self, response: &mut #{operation}::Response) -> Option<Self::Output> {
#{BeforeParseResponse}
// This is an error, defer to the non-streaming parser
if !response.http().status().is_success() && response.http().status().as_u16() != $successCode {
return None;
@ -161,6 +162,9 @@ class HttpBoundProtocolTraitImplGenerator(
"E" to symbolProvider.symbolForOperationError(operationShape),
"parse_streaming_response" to parseStreamingResponse(operationShape, customizations),
"parse_error" to parseError(operationShape, customizations),
"BeforeParseResponse" to writable {
writeCustomizations(customizations, OperationSection.BeforeParseResponse(customizations, "response"))
},
*codegenScope,
)
}