Catching DynamoDB errors
Until now, we discussed how to perform various operations in DynamoDB. We saw how to use AWS provided by SDK and play around with DynamoDB items and attributes. Amazon claims that AWS provides high availability and reliability, which is quite true considering the years of experience I have gained from using their services, but we still cannot deny the possibility where services such as DynamoDB might not perform as expected. So, it's important to make sure that we have a proper error catching mechanism to ensure that the disaster recovery system is in place. In this recipe, we are going to see how to catch such errors.
Getting ready
To get started with this recipe, you should have your workstation ready with the Eclipse IDE.
How to do it…
Catching errors in DynamoDB is quite easy. Whenever we perform any operations, we need to put them in the try
block. Along with it, we need to put a couple of catch blocks in order to catch the errors.
Here, we will consider a simple...