Class SdkServiceException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- software.amazon.awssdk.core.exception.SdkException
-
- software.amazon.awssdk.core.exception.SdkServiceException
-
- All Implemented Interfaces:
Serializable
,SdkPojo
public class SdkServiceException extends SdkException implements SdkPojo
Extension of SdkException that represents an error response returned by the requested downstream service. Receiving an exception of this type indicates that the caller's request was correctly transmitted to the service, but for some reason, the service was not able to process it, and returned an error response instead.SdkServiceException provides callers several pieces of information that can be used to obtain more information about the error and why it occurred.
- See Also:
SdkClientException
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SdkServiceException.Builder
protected static class
SdkServiceException.BuilderImpl
-
Constructor Summary
Constructors Modifier Constructor Description protected
SdkServiceException(SdkServiceException.Builder b)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SdkServiceException.Builder
builder()
String
extendedRequestId()
The extendedRequestId that was returned by the called service.boolean
isClockSkewException()
Specifies whether an exception may have been caused by clock skew.boolean
isRetryableException()
Specifies whether an exception is retryable.boolean
isThrottlingException()
Specifies whether an exception is caused by throttling.String
requestId()
The requestId that was returned by the called service.List<SdkField<?>>
sdkFields()
static Class<? extends SdkServiceException.Builder>
serializableBuilderClass()
int
statusCode()
The status code that was returned by the called service.SdkServiceException.Builder
toBuilder()
Create aSdkServiceException.Builder
initialized with the properties of thisSdkServiceException
.-
Methods inherited from class software.amazon.awssdk.core.exception.SdkException
create, retryable
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFieldNameToField
-
-
-
-
Constructor Detail
-
SdkServiceException
protected SdkServiceException(SdkServiceException.Builder b)
-
-
Method Detail
-
requestId
public String requestId()
The requestId that was returned by the called service.- Returns:
- String containing the requestId
-
extendedRequestId
public String extendedRequestId()
The extendedRequestId that was returned by the called service.- Returns:
- String ctontaining the extendedRequestId
-
statusCode
public int statusCode()
The status code that was returned by the called service.- Returns:
- int containing the status code.
-
isClockSkewException
public boolean isClockSkewException()
Specifies whether an exception may have been caused by clock skew.
-
isThrottlingException
public boolean isThrottlingException()
Specifies whether an exception is caused by throttling. This method by default returnstrue
if the status code is equal to 429 Too Many Requests but subclasses can override this method to signal that the specific subclass is considered a throttling exception.- Returns:
- true if the exception is classified as throttling, otherwise false.
- See Also:
isRetryableException()
-
isRetryableException
public boolean isRetryableException()
Specifies whether an exception is retryable. This method by default returnsfalse
but subclasses can override this value to signal that the specific subclass is considered retryable.- Returns:
- true if the exception is classified as retryable, otherwise false.
- See Also:
isThrottlingException()
-
builder
public static SdkServiceException.Builder builder()
- Returns:
SdkServiceException.Builder
instance to construct a newSdkServiceException
.
-
toBuilder
public SdkServiceException.Builder toBuilder()
Create aSdkServiceException.Builder
initialized with the properties of thisSdkServiceException
.- Overrides:
toBuilder
in classSdkException
- Returns:
- A new builder initialized with this config's properties.
-
serializableBuilderClass
public static Class<? extends SdkServiceException.Builder> serializableBuilderClass()
-
-