Unverified Commit e447a227 authored by ysaito1001's avatar ysaito1001 Committed by GitHub
Browse files

Re-point those using `BuildError` from smithy-http to smithy-types (#3070)



## Motivation and Context
Completes #3054 (a follow-up on #3032)

## Description
#3032 moved `BuildError` from `aws_smithy_http::operation::error` to
`aws_smithy_types::error::operation`. That PR also left "breadcrumbs",
so that customers could still consume `BuldError` from `aws_smithy_http`
after the move.

This PR turns breadcrumbs into deprecation messages (via
`#[deprecated(...)]`) and updates existing places that used to use moved
types from `aws_smithy_http` to `aws_smithy_types`.

## Testing
Relied on tests in CI.

## Checklist
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: default avatarRussell Cohen <rcoh@amazon.com>
parent 307f0ed1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -426,3 +426,11 @@ message = "**This change has [detailed upgrade guidance](https://github.com/awsl
references = ["smithy-rs#3043", "smithy-rs#3078"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" }
author = "rcoh"

[[smithy-rs]]
message = """
`aws_smithy_http::operation::error::{BuildError, SerializationError}` have been moved to `aws_smithy_types::error::operation::{BuildError, SerializationError}`. Type aliases for them are left in `aws_smithy_http` for backwards compatibility but are deprecated.
"""
references = ["smithy-rs#3054", "smithy-rs#3070"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "all" }
author = "ysaito1001"
+2 −2
Original line number Diff line number Diff line
@@ -16,12 +16,12 @@ aws-credential-types = { path = "../aws-credential-types" }
aws-http = { path = "../aws-http" }
aws-runtime = { path = "../aws-runtime" }
aws-sigv4 = { path = "../aws-sigv4" }
aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async", features = ["rt-tokio"] }
aws-smithy-checksums = { path = "../../../rust-runtime/aws-smithy-checksums" }
aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http" }
aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] }
aws-smithy-runtime = { path = "../../../rust-runtime/aws-smithy-runtime", features = ["client"] }
aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] }
aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" }
aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async", features = ["rt-tokio"] }
bytes = "1"
hex = "0.4.3"
http = "0.2.9"
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ use aws_sigv4::http_request::SignableBody;
use aws_smithy_checksums::ChecksumAlgorithm;
use aws_smithy_checksums::{body::calculate, http::HttpChecksum};
use aws_smithy_http::body::{BoxBody, SdkBody};
use aws_smithy_http::operation::error::BuildError;
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::{
    BeforeSerializationInterceptorContextRef, BeforeTransmitInterceptorContextMut, Input,
@@ -23,6 +22,7 @@ use aws_smithy_runtime_api::client::interceptors::Intercept;
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_types::config_bag::{ConfigBag, Layer, Storable, StoreReplace};
use aws_smithy_types::error::operation::BuildError;
use http::HeaderValue;
use http_body::Body;
use std::{fmt, mem};
+1 −1
Original line number Diff line number Diff line
@@ -6,8 +6,8 @@
use aws_sdk_s3::config::{Credentials, Region};
use aws_sdk_s3::error::DisplayErrorContext;
use aws_sdk_s3::Client;
use aws_smithy_http::operation::error::BuildError;
use aws_smithy_runtime::client::http::test_util::capture_request;
use aws_smithy_types::error::operation::BuildError;

#[tokio::test]
async fn test_error_when_required_query_param_is_unset() {
+2 −2
Original line number Diff line number Diff line
@@ -75,8 +75,8 @@ sealed class BuilderSection(name: String) : Section(name) {
/** Customizations for BuilderGenerator */
abstract class BuilderCustomization : NamedCustomization<BuilderSection>()

fun RuntimeConfig.operationBuildError() = RuntimeType.operationModule(this).resolve("error::BuildError")
fun RuntimeConfig.serializationError() = RuntimeType.operationModule(this).resolve("error::SerializationError")
fun RuntimeConfig.operationBuildError() = RuntimeType.smithyTypes(this).resolve("error::operation::BuildError")
fun RuntimeConfig.serializationError() = RuntimeType.smithyTypes(this).resolve("error::operation::SerializationError")

fun MemberShape.enforceRequired(
    field: Writable,
Loading