|
1 | 1 | <!-- Do not manually edit this file. Use the `changelogger` tool. -->
|
| 2 | +March 23rd, 2023 |
| 3 | +================ |
| 4 | +**Breaking Changes:** |
| 5 | +- ⚠🎉 (all, [smithy-rs#2467](https://github.com/awslabs/smithy-rs/issues/2467)) Update MSRV to 1.66.1 |
| 6 | +- ⚠ (client, [smithy-rs#76](https://github.com/awslabs/smithy-rs/issues/76), [smithy-rs#2129](https://github.com/awslabs/smithy-rs/issues/2129)) Generic clients no longer expose a `request_id()` function on errors. To get request ID functionality, use the SDK code generator. |
| 7 | +- ⚠ (client, [smithy-rs#76](https://github.com/awslabs/smithy-rs/issues/76), [smithy-rs#2129](https://github.com/awslabs/smithy-rs/issues/2129)) The `message()` and `code()` methods on errors have been moved into `ProvideErrorMetadata` trait. This trait will need to be imported to continue calling these. |
| 8 | +- ⚠ (client, [smithy-rs#76](https://github.com/awslabs/smithy-rs/issues/76), [smithy-rs#2129](https://github.com/awslabs/smithy-rs/issues/2129), [smithy-rs#2075](https://github.com/awslabs/smithy-rs/issues/2075)) The `*Error` and `*ErrorKind` types have been combined to make error matching simpler. |
| 9 | + <details> |
| 10 | + <summary>Example with S3</summary> |
| 11 | + **Before:** |
| 12 | + ```rust |
| 13 | + let result = client |
| 14 | + .get_object() |
| 15 | + .bucket(BUCKET_NAME) |
| 16 | + .key("some-key") |
| 17 | + .send() |
| 18 | + .await; |
| 19 | + match result { |
| 20 | + Ok(_output) => { /* Do something with the output */ } |
| 21 | + Err(err) => match err.into_service_error() { |
| 22 | + GetObjectError { kind, .. } => match kind { |
| 23 | + GetObjectErrorKind::InvalidObjectState(value) => println!("invalid object state: {:?}", value), |
| 24 | + GetObjectErrorKind::NoSuchKey(_) => println!("object didn't exist"), |
| 25 | + } |
| 26 | + err @ GetObjectError { .. } if err.code() == Some("SomeUnmodeledError") => {} |
| 27 | + err @ _ => return Err(err.into()), |
| 28 | + }, |
| 29 | + } |
| 30 | + ``` |
| 31 | + **After:** |
| 32 | + ```rust |
| 33 | + // Needed to access the `.code()` function on the error type: |
| 34 | + use aws_sdk_s3::types::ProvideErrorMetadata; |
| 35 | + let result = client |
| 36 | + .get_object() |
| 37 | + .bucket(BUCKET_NAME) |
| 38 | + .key("some-key") |
| 39 | + .send() |
| 40 | + .await; |
| 41 | + match result { |
| 42 | + Ok(_output) => { /* Do something with the output */ } |
| 43 | + Err(err) => match err.into_service_error() { |
| 44 | + GetObjectError::InvalidObjectState(value) => { |
| 45 | + println!("invalid object state: {:?}", value); |
| 46 | + } |
| 47 | + GetObjectError::NoSuchKey(_) => { |
| 48 | + println!("object didn't exist"); |
| 49 | + } |
| 50 | + err if err.code() == Some("SomeUnmodeledError") => {} |
| 51 | + err @ _ => return Err(err.into()), |
| 52 | + }, |
| 53 | + } |
| 54 | + ``` |
| 55 | + </details> |
| 56 | +- ⚠ (client, [smithy-rs#76](https://github.com/awslabs/smithy-rs/issues/76), [smithy-rs#2129](https://github.com/awslabs/smithy-rs/issues/2129)) `aws_smithy_types::Error` has been renamed to `aws_smithy_types::error::ErrorMetadata`. |
| 57 | +- ⚠ (server, [smithy-rs#2436](https://github.com/awslabs/smithy-rs/issues/2436)) Remove unnecessary type parameter `B` from `Upgrade` service. |
| 58 | +- 🐛⚠ (server, [smithy-rs#2382](https://github.com/awslabs/smithy-rs/issues/2382)) Smithy members named `send` were previously renamed to `send_value` at codegen time. These will now be called `send` in the generated code. |
| 59 | +- ⚠ (client, [smithy-rs#2448](https://github.com/awslabs/smithy-rs/issues/2448)) The modules in generated client crates have been reorganized. See the [Client Crate Reorganization Upgrade Guidance](https://github.com/awslabs/smithy-rs/discussions/2449) to see how to fix your code after this change. |
| 60 | +- ⚠ (server, [smithy-rs#2438](https://github.com/awslabs/smithy-rs/issues/2438)) Servers can send the `ServerRequestId` in the response headers. |
| 61 | + Servers need to create their service using the new layer builder `ServerRequestIdProviderLayer::new_with_response_header`: |
| 62 | + ``` |
| 63 | + let app = app |
| 64 | + .layer(&ServerRequestIdProviderLayer::new_with_response_header(HeaderName::from_static("x-request-id"))); |
| 65 | + ``` |
| 66 | + |
| 67 | +**New this release:** |
| 68 | +- 🐛🎉 (client, [aws-sdk-rust#740](https://github.com/awslabs/aws-sdk-rust/issues/740)) Fluent builder methods on the client are now marked as deprecated when the related operation is deprecated. |
| 69 | +- 🎉 (all, [smithy-rs#2398](https://github.com/awslabs/smithy-rs/issues/2398)) Add support for the `awsQueryCompatible` trait. This allows services to continue supporting a custom error code (via the `awsQueryError` trait) when the services migrate their protocol from `awsQuery` to `awsJson1_0` annotated with `awsQueryCompatible`. |
| 70 | + <details> |
| 71 | + <summary>Click to expand for more details...</summary> |
| 72 | + |
| 73 | + After the migration, services will include an additional header `x-amzn-query-error` in their responses whose value is in the form of `<error code>;<error type>`. An example response looks something like |
| 74 | + ``` |
| 75 | + HTTP/1.1 400 |
| 76 | + x-amzn-query-error: AWS.SimpleQueueService.NonExistentQueue;Sender |
| 77 | + Date: Wed, 08 Sep 2021 23:46:52 GMT |
| 78 | + Content-Type: application/x-amz-json-1.0 |
| 79 | + Content-Length: 163 |
| 80 | + |
| 81 | + { |
| 82 | + "__type": "com.amazonaws.sqs#QueueDoesNotExist", |
| 83 | + "message": "some user-visible message" |
| 84 | + } |
| 85 | + ``` |
| 86 | + `<error code>` is `AWS.SimpleQueueService.NonExistentQueue` and `<error type>` is `Sender`. |
| 87 | + |
| 88 | + If an operation results in an error that causes a service to send back the response above, you can access `<error code>` and `<error type>` as follows: |
| 89 | + ```rust |
| 90 | + match client.some_operation().send().await { |
| 91 | + Ok(_) => { /* success */ } |
| 92 | + Err(sdk_err) => { |
| 93 | + let err = sdk_err.into_service_error(); |
| 94 | + assert_eq!( |
| 95 | + error.meta().code(), |
| 96 | + Some("AWS.SimpleQueueService.NonExistentQueue"), |
| 97 | + ); |
| 98 | + assert_eq!(error.meta().extra("type"), Some("Sender")); |
| 99 | + } |
| 100 | + } |
| 101 | + </details> |
| 102 | + ``` |
| 103 | +- 🎉 (client, [smithy-rs#2428](https://github.com/awslabs/smithy-rs/issues/2428), [smithy-rs#2208](https://github.com/awslabs/smithy-rs/issues/2208)) `SdkError` variants can now be constructed for easier unit testing. |
| 104 | +- 🐛 (server, [smithy-rs#2441](https://github.com/awslabs/smithy-rs/issues/2441)) Fix `FilterByOperationName` plugin. This previous caused services with this applied to fail to compile due to mismatched bounds. |
| 105 | +- (client, [smithy-rs#2437](https://github.com/awslabs/smithy-rs/issues/2437), [aws-sdk-rust#600](https://github.com/awslabs/aws-sdk-rust/issues/600)) Add more client re-exports. Specifically, it re-exports `aws_smithy_http::body::SdkBody`, `aws_smithy_http::byte_stream::error::Error`, and `aws_smithy_http::operation::{Request, Response}`. |
| 106 | +- 🐛 (all, [smithy-rs#2226](https://github.com/awslabs/smithy-rs/issues/2226)) Fix bug in timestamp format resolution. Prior to this fix, the timestamp format may have been incorrect if set on the target instead of on the member. |
| 107 | +- (all, [smithy-rs#2226](https://github.com/awslabs/smithy-rs/issues/2226)) Add support for offsets when parsing datetimes. RFC3339 date times now support offsets like `-0200` |
| 108 | +- (client, [aws-sdk-rust#160](https://github.com/awslabs/aws-sdk-rust/issues/160), [smithy-rs#2445](https://github.com/awslabs/smithy-rs/issues/2445)) Reconnect on transient errors. |
| 109 | + |
| 110 | + Note: **this behavior is disabled by default for generic clients**. It can be enabled with |
| 111 | + `aws_smithy_client::Builder::reconnect_on_transient_errors` |
| 112 | + |
| 113 | + If a transient error (timeout, 500, 503, 503) is encountered, the connection will be evicted from the pool and will not |
| 114 | + be reused. |
| 115 | +- (all, [smithy-rs#2474](https://github.com/awslabs/smithy-rs/issues/2474)) Increase Tokio version to 1.23.1 for all crates. This is to address [RUSTSEC-2023-0001](https://rustsec.org/advisories/RUSTSEC-2023-0001) |
| 116 | + |
| 117 | + |
2 | 118 | January 25th, 2023
|
3 | 119 | ==================
|
4 | 120 | **New this release:**
|
|
0 commit comments