This allows to programmatically determine which item failed and for what reason. The alternative of parsing the human-readable error message is obviously worse.
The response looks like this:
{
"__type": "com.amazonaws.dynamodb.v20120810#TransactionCanceledException",
"CancellationReasons": [
{
"Code": "ConditionalCheckFailed",
"Message": "The conditional request failed"
},
{
"Code": "ConditionalCheckFailed",
"Message": "The conditional request failed"
}
],
"Message": "Transaction cancelled, please refer cancellation reasons for specific reasons [ConditionalCheckFailed, ConditionalCheckFailed]"
}