1"""
2Exceptions that are specific to the dynamodb module.
3"""
4from boto.exception import BotoServerError, BotoClientError
5from boto.exception import DynamoDBResponseError
6
7
8class DynamoDBExpiredTokenError(BotoServerError):
9    """
10    Raised when a DynamoDB security token expires. This is generally boto's
11    (or the user's) notice to renew their DynamoDB security tokens.
12    """
13    pass
14
15
16class DynamoDBKeyNotFoundError(BotoClientError):
17    """
18    Raised when attempting to retrieve or interact with an item whose key
19    can't be found.
20    """
21    pass
22
23
24class DynamoDBItemError(BotoClientError):
25    """
26    Raised when invalid parameters are passed when creating a
27    new Item in DynamoDB.
28    """
29    pass
30
31
32class DynamoDBNumberError(BotoClientError):
33    """
34    Raised in the event of incompatible numeric type casting.
35    """
36    pass
37
38
39class DynamoDBConditionalCheckFailedError(DynamoDBResponseError):
40    """
41    Raised when a ConditionalCheckFailedException response is received.
42    This happens when a conditional check, expressed via the expected_value
43    paramenter, fails.
44    """
45    pass
46
47
48class DynamoDBValidationError(DynamoDBResponseError):
49    """
50    Raised when a ValidationException response is received. This happens
51    when one or more required parameter values are missing, or if the item
52    has exceeded the 64Kb size limit.
53    """
54    pass
55
56
57class DynamoDBThroughputExceededError(DynamoDBResponseError):
58    """
59    Raised when the provisioned throughput has been exceeded.
60    Normally, when provisioned throughput is exceeded the operation
61    is retried.  If the retries are exhausted then this exception
62    will be raised.
63    """
64    pass
65