From c29accf18358a208386f7062ded3a4c160b3e419 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Mon, 14 Nov 2022 15:18:38 -0800 Subject: [PATCH] Incorporate feedback --- aws/rust-runtime/aws-config/src/imds/client.rs | 2 +- rust-runtime/aws-smithy-http/src/event_stream/receiver.rs | 7 ++----- rust-runtime/aws-smithy-http/src/event_stream/sender.rs | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/aws/rust-runtime/aws-config/src/imds/client.rs b/aws/rust-runtime/aws-config/src/imds/client.rs index db8c0f0eed..5343781971 100644 --- a/aws/rust-runtime/aws-config/src/imds/client.rs +++ b/aws/rust-runtime/aws-config/src/imds/client.rs @@ -218,7 +218,7 @@ impl Client { InnerImdsError::InvalidUtf8 => { ImdsError::Unexpected("IMDS returned invalid UTF-8".into()) } - _ => ImdsError::ErrorResponse { + InnerImdsError::BadStatus => ImdsError::ErrorResponse { response: context.into_raw().into_parts().0, }, }, diff --git a/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs b/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs index 7ffdd83051..e079bdc62f 100644 --- a/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs +++ b/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs @@ -162,10 +162,7 @@ impl Receiver { Err(SdkError::service_error(err, RawMessage::Decoded(message))) } }, - Err(err) => Err(SdkError::response_error( - Box::new(err), - RawMessage::Decoded(message), - )), + Err(err) => Err(SdkError::response_error(err, RawMessage::Decoded(message))), } } @@ -195,7 +192,7 @@ impl Receiver { .decode_frame(self.buffer.buffered()) .map_err(|err| { SdkError::response_error( - Box::new(err), + err, // the buffer has been consumed RawMessage::Invalid(None), ) diff --git a/rust-runtime/aws-smithy-http/src/event_stream/sender.rs b/rust-runtime/aws-smithy-http/src/event_stream/sender.rs index 47e72e410e..10822e6917 100644 --- a/rust-runtime/aws-smithy-http/src/event_stream/sender.rs +++ b/rust-runtime/aws-smithy-http/src/event_stream/sender.rs @@ -55,7 +55,7 @@ pub struct MessageStreamError { } #[derive(Debug)] -pub enum MessageStreamErrorKind { +enum MessageStreamErrorKind { Unhandled(Box), }