Package software.amazon.awssdk.imds
Class Ec2MetadataClientException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- software.amazon.awssdk.core.exception.SdkException
-
- software.amazon.awssdk.core.exception.SdkClientException
-
- software.amazon.awssdk.imds.Ec2MetadataClientException
-
- All Implemented Interfaces:
Serializable
public final class Ec2MetadataClientException extends SdkClientException
ExtendsSdkClientExceptionfor 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 viarawResponse()containing the error response body - HTTP headers viasdkHttpResponse()providing additional error context from the response- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEc2MetadataClientException.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Ec2MetadataClientException.Builderbuilder()SdkBytesrawResponse()Returns the response payload as bytes.SdkHttpResponsesdkHttpResponse()Returns a map of HTTP headers associated with the error response.intstatusCode()-
Methods inherited from class software.amazon.awssdk.core.exception.SdkClientException
create, create, getMessage, toBuilder
-
Methods inherited from class software.amazon.awssdk.core.exception.SdkException
numAttempts, rawMessage, retryable
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
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()
-
-