Class Ec2MetadataClientException

All Implemented Interfaces:
Serializable

public final class Ec2MetadataClientException extends SdkClientException
Extends SdkClientException for EC2 Instance Metadata Service (IMDS) non-successful responses (4XX codes). Provides detailed error information through:

- HTTP status code via statusCode() for specific error handling - Raw response content via rawResponse() containing the error response body - HTTP headers via sdkHttpResponse() providing additional error context from the response

See Also:
  • Method Details

    • statusCode

      public int statusCode()
      Returns:
      The HTTP status code returned by the IMDS service.
    • rawResponse

      public SdkBytes rawResponse()
      Returns the response payload as bytes.
    • sdkHttpResponse

      public SdkHttpResponse sdkHttpResponse()
      Returns a map of HTTP headers associated with the error response.
    • builder

      public static Ec2MetadataClientException.Builder builder()