I wonder if the DynamoDBMapper.save() is asynchronous and what happens when something goes wrong? Should I surround the save with try / catch to deal with this?
I wonder if the DynamoDBMapper.save() is asynchronous and what happens when something goes wrong? Should I surround the save with try / catch to deal with this?
When using the
save,load, anddeletemethods,DynamoDBMapperwill throwDynamoDBMappingExceptions to indicate that domain classes are incorrectly annotated or otherwise incompatible with this class. Service exceptions will always be propagated asSdkClientException, and DynamoDB-specific subclasses such asConditionalCheckFailedExceptionwill be used when possible.
So, if anything goes wrong, you'll get an exception. But all those exceptions are inherited from RuntimeException, i.e. you are not required to catch them. But you are not banned of doing that: you can wrap your code in a try-catch and process them as you wish.