From 7477cfbc7e6278f2e57796fbce7914c76f2d542d Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Fri, 11 Nov 2022 16:35:41 -0800 Subject: [PATCH] Add error refactor changelog entries and re-export `DisplayErrorContext` (#1951) * Re-export `DisplayErrorContext` * Update changelog --- CHANGELOG.next.toml | 13 +++++++++++++ .../customizations/SmithyTypesPubUseGenerator.kt | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index ed13671732..98e726c6cc 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -103,3 +103,16 @@ message = "Upgrade to Smithy 1.26.2" references = ["smithy-rs#1972"] meta = { "breaking" = false, "tada" = false, "bug" = false } author = "rcoh" + +[[smithy-rs]] +message = "Several breaking changes have been made to errors. See [the upgrade guide](https://github.com/awslabs/smithy-rs/issues/1950) for more information." +references = ["smithy-rs#1926", "smithy-rs#1819"] +meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" } +author = "jdisanti" + +[[aws-sdk-rust]] +message = "Several breaking changes have been made to errors. See [the upgrade guide](https://github.com/awslabs/aws-sdk-rust/issues/657) for more information." +references = ["smithy-rs#1926", "smithy-rs#1819"] +meta = { "breaking" = true, "tada" = false, "bug" = false } +author = "jdisanti" + diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/SmithyTypesPubUseGenerator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/SmithyTypesPubUseGenerator.kt index f605e3a712..d9b3a2b45a 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/SmithyTypesPubUseGenerator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/SmithyTypesPubUseGenerator.kt @@ -59,7 +59,9 @@ internal fun pubUseTypes(runtimeConfig: RuntimeConfig, model: Model): List + ) + CargoDependency.SmithyTypes(runtimeConfig).asType().let { types -> + listOf(PubUseType(types.member("error::display::DisplayErrorContext")) { true }) + } + CargoDependency.SmithyHttp(runtimeConfig).asType().let { http -> listOf( PubUseType(http.member("result::SdkError")) { true }, PubUseType(http.member("byte_stream::ByteStream"), ::hasStreamingOperations),