Skip to content
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

S3Client.headObject does not throw NoSuchKeyException as documented #544

Closed
ghadishayban opened this issue Jun 13, 2018 · 3 comments
Closed
Labels
bug This issue is a bug.

Comments

@ghadishayban
Copy link

Expected Behavior

The docs say that headObject should return a NoSuchKeyException when not found.

Current Behavior

It does not throw NSKE. Instead, it throws an ordinary:

S3Exception null (Service: S3Client; Status Code: 404; Request ID: null)  software.amazon.awssdk.core.http.pipeline.stages.HandleResponseStage.handleErrorRes\
ponse (HandleResponseStage.java:114)

#147 appeared to fix this for getObject, but headObject still busted (there's even a test for it in that changeset.)

Steps to Reproduce (for bugs)

HEAD a non existent key with the S3Client

Your Environment

JDK 10 + AWS SDK v2 preview 10

@ghadishayban
Copy link
Author

I will add, I really don't care for throwing exceptions in such a common case. HEAD will either return stat meta or not.

@dagnir dagnir added the bug This issue is a bug. label Jun 14, 2018
@codylerum
Copy link

Also see #297

@zoewangg
Copy link
Contributor

This has been fixed as part of #830 and will be included in the next release.

aws-sdk-java-automation added a commit that referenced this issue Jun 26, 2019
…c7d8e32d

Pull request: release <- staging/ca1f986f-55eb-49fb-8bf5-40afc7d8e32d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants