Unverified Commit 692bf94b authored by Zelda Hessler's avatar Zelda Hessler Committed by GitHub
Browse files

Feature: add TimeoutError variant to SdkError (#886)

* feature: add TimeoutError variant to SdkError
add: TimeoutError variant to ImdsError
update: tests broken by new variant

* update: changelogs

* add: new inner timeout error RequestTimeoutError
update: tests broken by new inner error
rename: aws_smithy_client::hyper_ext::TimeoutError to HttpTimeoutError
add: missing dep to integration test

* revert: IMDS error change
update: content for HttpTimeoutError
fix: clippy lint

* add: back the source method to HttpTimeoutError
update: connector timeout tests
remove: TODO
parent 9424eaa7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ vNext (Month Day, Year)
**New this release**
- Improve docs on `aws-smithy-client` (smithy-rs#855)
- Fix http-body dependency version (smithy-rs#883, aws-sdk-rust#305)
- `SdkError` now includes a variant `TimeoutError` for when a request times out (smithy-rs#885)

**Breaking Changes**
- (aws-smithy-client): Extraneous `pub use SdkSuccess` removed from `aws_smithy_client::hyper_ext`. (smithy-rs#855)
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ vNext (Month Day, Year)
**New this release**

- :tada: Timeouts for requests are now configurable. You can set a timeout for each individual request attempt or for all attempts made for a request. (smithy-rs#831)
  - `SdkError` now includes a variant `TimeoutError` for when a request times out  (smithy-rs#885)
- Improve docs on `aws-smithy-client` (smithy-rs#855)
- Fix http-body dependency version (smithy-rs#883, aws-sdk-rust#305)

+2 −1
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ impl Client {
                Ok(token_failure) => *token_failure,
                Err(other) => ImdsError::Unexpected(other),
            },
            SdkError::TimeoutError(err) => ImdsError::IoError(err),
            SdkError::DispatchFailure(err) => ImdsError::IoError(err.into()),
            SdkError::ResponseError { err, .. } => ImdsError::IoError(err),
            SdkError::ServiceError {
@@ -259,7 +260,7 @@ impl Display for ImdsError {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            ImdsError::FailedToLoadToken(inner) => {
                write!(f, "failed to load session token: {}", inner)
                write!(f, "Failed to load session token: {}", inner)
            }
            ImdsError::InvalidPath => write!(
                f,
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" }
aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async" }
aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" }
tracing-subscriber = "0.2.18"
tokio  = { version = "1", features = ["full"]}
tokio  = { version = "1", features = ["full", "test-util"]}

[dev-dependencies]
aws-http = { path = "../../build/aws-sdk/sdk/aws-http"}
+1 −1
Original line number Diff line number Diff line
@@ -62,6 +62,6 @@ async fn test_timeout_service_ends_request_that_never_completes() {
        .await
        .unwrap_err();

    assert_eq!(format!("{:?}", err), "ConstructionFailure(TimedOutError)");
    assert_eq!(format!("{:?}", err), "TimeoutError(RequestTimeoutError { kind: \"API call (all attempts including retries)\", duration: 500ms })");
    assert_elapsed!(now, std::time::Duration::from_secs_f32(0.5));
}
Loading