-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-point those using BuildError
from smithy-http to smithy-types
#3070
Conversation
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
This commit addresses #3070 (comment)
A new generated diff is ready to view.
A new doc preview is ready to view. |
This commit addresses #3070 (comment)
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Co-authored-by: Russell Cohen <rcoh@amazon.com>
@@ -9,11 +9,17 @@ | |||
use aws_smithy_types::config_bag::{Storable, StoreReplace}; | |||
use std::borrow::Cow; | |||
|
|||
//TODO(runtimeCratesVersioningCleanup): Re-point those who use the following reexport to | |||
// directly depend on `aws_smithy_types` and remove the reexport below. | |||
//TODO(runtimeCratesVersioningCleanup): Re-point those who use the deprecated type aliases to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO for pre-GA or will we do this post GA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect it's for pre-GA. After we've released a new version (likely a breaking release), we'll go ahead and remove those deprecated type aliases.
pub use aws_smithy_types::error::operation::{BuildError, SerializationError}; | ||
/// An error occurred attempting to build an `Operation` from an input. | ||
#[deprecated(note = "Moved to `aws_smithy_types::error::operation::BuildError`.")] | ||
pub type BuildError = aws_smithy_types::error::operation::BuildError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any code generated from this release will raise a Serialization(#[from] aws_smithy_types::error::operation::SerializationError)
error. So if a customer's codebase has a function that takes the re-exported, deprecated type from aws_smithy_http
instead of the one from aws_smithy_types
, will the code compile (with a deprecated warning)? Or will the compiler produce an error, stating that the two types are not the same?
let error = some_call_that_generates_a_serialization_error();
match error {
Serialization(se) => handle_se(se),
_ => (),
}
// Will the compiler produce an error here, stating that the passed-in type is
// `aws_smithy_types::error::operation::SerializationError`?
fn handle_error(e: aws_smithy_http::operation::error::SerializationError) {
// ...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will the code compile (with a deprecated warning)? Or will the compiler produce an error, stating that the two types are not the same?
It'll be the former, but whether it compiles or not ultimately depends on the compiler's warn level configured on a customer's end.
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
Completes #3054 (a follow-up on #3032)
Description
#3032 moved
BuildError
fromaws_smithy_http::operation::error
toaws_smithy_types::error::operation
. That PR also left "breadcrumbs", so that customers could still consumeBuldError
fromaws_smithy_http
after the move.This PR turns breadcrumbs into deprecation messages (via
#[deprecated(...)]
) and updates existing places that used to use moved types fromaws_smithy_http
toaws_smithy_types
.Testing
Relied on tests in CI.
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.