boto/boto — pull request #710 by tmorgan (2012-04-19 14:12:51+00:00)
Title: Fix #580 - add custom exception for Layer1.put_item() with expected_value.

class DynamoDBConditionalCheckFailedError(DynamoDBResponseError):

I didn't use the name suggested in the bug, but considered it'd be better to match the error code given here, http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/ErrorHandling.html but don't really care if that's changed. The change is backwards compatible naturally, so any code with custom checks for the error_code attribute checking the message will still work. I've updated the tests to use assertRaises, but the test passed as it was.

Also, in a separate commit, I added,

class DynamoDBValidationError(DynamoDBResponseError):

This is a similar case to the conditional check, in that you often want to check for an item going over the item size limit when performing updates, and it's useful to be able to check for that directly. Added a test for that in test_layer1 in this commit also.