Error Component
Each error has three components:
- An HTTP status code
- An exception name
- An error message
Error Messages and Codes
Status Code 400
AccessDeniedException
Access denied: The client did not correctly sign the request.ConditionalCheckFailedException
The conditional request failed: You specified a condition that evaluated to falseIncompleteSignatureException
The request signature does not conform to AWS standards: The request signature did not include all of the required components.ItemCollectionSizeLimitExceededException
Collection size exceeded: For a table with a local secondary index, a group of items with the same partition key value has exceeded the maximum size limit of 10 GBLimitExceededException
Too many operations for a given subscriber: There are too many concurrent control plane operations. The cumulative number of tables and indexes in the CREATING, DELETING, or UPDATING state cannot exceed 50.MissingAuthenticationTokenException
Request must contain a valid (registered) AWS Access Key ID: The request did not include the required authorization header, or it was malformed.ProvisionedThroughputExceededException
You exceeded your maximum allowed provisioned throughput for a table or for one or more global secondary indexes. To view performance metrics for provisioned throughput vs. consumed throughput, open the Amazon CloudWatch console.RequestLimitExceeded
Throughput exceeds the current throughput limit for your account.ResourceInUseException
The resource which you are attempting to change is in use.ResourceNotFoundException
Requested resource not found.ThrottlingException
Rate of requests exceeds the allowed throughput: This exception is returned as an AmazonServiceException response with a THROTTLING_EXCEPTION status code. This exception might be returned if you perform control plane API operations too rapidly.UnrecognizedClientException
The Access Key ID or security token is invalid.: The request signature is incorrect. The most likely cause is an invalid AWS access key ID or secret key.ValidationException
Varies, depending upon the specific error(s) encountered: This error can occur for several reasons, such as a required parameter that is missing, a value that is out of range, or mismatched data types. The error message contains details about the specific part of the request that caused the error.HTTP Status Code 5xx
An HTTP 5xx status code indicates a problem that must be resolved by AWS.
Internal Server Error (HTTP 500)
DynamoDB could not process your request.Service Unavailable (HTTP 503)
DynamoDB is currently unavailable. (This should be a temporary state.)Error Handling the Application
the try-catch construct handles two different kinds of exceptions:
- AmazonServiceException: Thrown if the client request was correctly transmitted to DynamoDB, but DynamoDB could not process the request and returned an error response instead.
- AmazonClientException: Thrown if the client could not get a response from a service, or if the client could not parse the response from a service.
Error Retries and Exponential Backoff
- The usual technique for dealing with these error responses in a networked environment is to implement retries in the client application. This technique increases the reliability of the application.
- Each AWS SDK implements retry logic automatically. You can modify the retry parameters to your needs.
- If you're not using an AWS SDK, you should retry original requests that receive server errors (5xx). However, client errors (4xx, other than a ThrottlingException or a ProvisionedThroughputExceededException) indicate that you need to revise the request itself to correct the problem before trying again.
- In addition to simple retries, each AWS SDK implements an exponential backoff algorithm for better flow control.
// Dynamo DB's batch operations (BatchGetItem
and BatchWriteItem) are implemented as
wrappers around other non-batch DynamoDB operations. The batch
operations return information about individual requests that fail so
that you can diagnose the problem and retry the operation.