-
Notifications
You must be signed in to change notification settings - Fork 662
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 HeadObject still doesn't return types.NotFound error #2084
Comments
Hi @sachevl , Thanks for opening the issue. I'm able to confirm this is an issue. This occurs because we parse the error type from the request body. Since HeadObject and HeadBucket requests don't return a body, the SDK should check the headers for the error type, and it doesn't do that yet. This requires customization. I'll add to the backlog. Thanks, |
I found this works as expected for HeadBucket, not for HeadObject. It appears the deserializer for HeadObject is missing this part: aws-sdk-go-v2/service/s3/deserializers.go Lines 6753 to 6754 in a86beba
I think to preserve backwards compatibility, the SDK would need to continue wrapping the current error in // Unfortunately HeadObject doesn't consistently wrap errors in s3.NotFound
// https://github.com/aws/aws-sdk-go-v2/issues/2084
var apiError smithy.APIError
if errors.As(err, &apiError) && apiError.ErrorCode() == "NotFound" {
...
} |
|
Describe the bug
issue #1049 claims to add
NotFound
as an error forHeadBucket
andHeadObject
methods. However proper error is not returned stillExpected Behavior
Current Behavior
Current behavior doesn't cast
err
totypes.NotFound
when object doesn't existReproduction Steps
run the code from expected behavior against non existing s3 object
Possible Solution
Fix smithy model. Add unit tests to ensure correct error casting
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
the latest
Compiler and Version used
go version go1.20.3 linux/amd64
Operating System and version
AL2
The text was updated successfully, but these errors were encountered: