IMDS returns SdkClientException on 4XX errors, but reading autoscaling lifecycle state can return 404. #5786
Labels
feature-request
A feature should be added or improved.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Describe the feature
IMDS client should return SdkServiceException when an http request is returned from the service. It's use of SdkClientException doesn't match the description in the docs: https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/handling-exceptions.html#sdkclientexception, to wit:
A request that recieves a response cannot be a client exception. It made the call, the service rejected it.
Use Case
IMDS client returns SdkClientExceptions unconditionally on 4XX errors (
aws-sdk-java-v2/core/imds/src/main/java/software/amazon/awssdk/imds/internal/AsyncHttpRequestHelper.java
Line 89 in 7eae4d8
Proposed Solution
Return an SdkServiceException any time there is an actual service response.
Other Information
No response
Acknowledgements
AWS Java SDK version used
2
JDK version used
17
Operating System and version
linux 6.11 (nixos)
The text was updated successfully, but these errors were encountered: