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
S3 missing an error type for NoSuchTagSet #675
Comments
Hi @taylor-sutton , Thanks for reaching out. If you did not know, all of the AWS SDKs are code generated from the API models of each AWS service. In this case, S3 did not specify this as an error type in their model as you can see here (linking v1 model since v2 model is in raw format): "GetBucketTagging":{
"name":"GetBucketTagging",
"http":{
"method":"GET",
"requestUri":"/{Bucket}?tagging"
},
"input":{"shape":"GetBucketTaggingRequest"},
"output":{"shape":"GetBucketTaggingOutput"},
"documentationUrl":"http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETtagging.html",
"staticContextParams":{
"UseS3ExpressControlEndpoint":{"value":true}
}
}, As seen in this operation definition, this is missing an Here is an example of how a modeled error should look like: "HeadBucket":{
"name":"HeadBucket",
"http":{
"method":"HEAD",
"requestUri":"/{Bucket}"
},
"input":{"shape":"HeadBucketRequest"},
"output":{"shape":"HeadBucketOutput"},
"errors":[
{"shape":"NoSuchBucket"}
],
"documentationUrl":"http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketHEAD.html"
}, Since the S3 team did not specify this as an error type in their API, the SDK will not generate a concrete type for it, and there is nothing we can do on the SDK side to introduce this without a model change. Here is a related issue on the JS SDK basically referring to the same problem with
So you could get around this by simply doing string comparison which should be safe. if err != nil {
if strings.Contains(err.Error(), "NoSuchTagSet") {
fmt.Println("NoSuchTagSet error occurred")
}
} Thanks, |
Hi @RanVaknin , thanks for your response. Is there an appropriate place I can nudge (or add to an existing nudge) the S3 team to update their data model? Since it sounds like there is nothing on the SDK side, feel free to close this issue. |
Hi @taylor-sutton , I have created another internal ticket with the S3 team with very detailed instructions on what needs to change on their backend to make it as easy of a change as possible. I just want to set your expectation that S3 is an enormous team both in terms of the size of the organization and the amount of work they handle, so it might take a while until this ticket makes it to the right person, and until it gets prioritzied. Transferring to the cross-sdk repo for further tracking. Thanks again, |
Describe the bug
As per https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html - the GetBucketTagging operation can return with a code NoSuchTagSet. However in s3 types, there is no corresponding error type.
Expected Behavior
I am able to refer to a
types.NoSuchTagSet
to type-safely check for this error.Current Behavior
I get the following:
when showing the error via
fmt.Printf("%+v\n", err)
Reproduction Steps
I am not sure the best way to create an S3 bucket that doesn't have any associated tag set, as opposed to having an empty tag set associated. In my case I see this for the bucket
amazon-connect-1cc70ca065cd
:Output:
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Complete go.mod:
Compiler and Version used
go version go1.21.3 darwin/arm64
Operating System and version
macOS 14.2.1
The text was updated successfully, but these errors were encountered: