mirror of
https://github.com/sprockets/sprockets.clients.dynamodb.git
synced 2024-11-23 19:29:51 +00:00
Merge pull request #3 from sprockets/fix-exceptions
Fix the ThroughputExceeded exception, add missing ones
This commit is contained in:
commit
a81aaa02d0
2 changed files with 20 additions and 5 deletions
|
@ -4,7 +4,7 @@ except ImportError as error:
|
||||||
def DynamoDB(*args, **kwargs):
|
def DynamoDB(*args, **kwargs):
|
||||||
raise error
|
raise error
|
||||||
|
|
||||||
version_info = (0, 1, 0)
|
version_info = (0, 2, 0)
|
||||||
__version__ = '.'.join(str(v) for v in version_info)
|
__version__ = '.'.join(str(v) for v in version_info)
|
||||||
|
|
||||||
# Response constants
|
# Response constants
|
||||||
|
|
|
@ -12,6 +12,7 @@ class DynamoDBException(Exception):
|
||||||
:ivar msg: The error message
|
:ivar msg: The error message
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(DynamoDBException, self).__init__(*args, **kwargs)
|
super(DynamoDBException, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
@ -167,7 +168,10 @@ class ServiceUnavailable(DynamoDBException):
|
||||||
|
|
||||||
|
|
||||||
class ThrottlingException(DynamoDBException):
|
class ThrottlingException(DynamoDBException):
|
||||||
"""The request was denied due to request throttling."""
|
"""This exception might be returned if the following API operations are
|
||||||
|
requested too rapidly: CreateTable; UpdateTable; DeleteTable.
|
||||||
|
|
||||||
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@ -178,17 +182,28 @@ class TimeoutException(DynamoDBException):
|
||||||
|
|
||||||
class ValidationException(DynamoDBException):
|
class ValidationException(DynamoDBException):
|
||||||
"""The input fails to satisfy the constraints specified by an AWS service.
|
"""The input fails to satisfy the constraints specified by an AWS service.
|
||||||
|
This error can occur for several reasons, such as a required parameter
|
||||||
|
that is missing, a value that is out range, or mismatched data types. The
|
||||||
|
error message contains details about the specific part of the request that
|
||||||
|
caused the error.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
MAP = {
|
MAP = {
|
||||||
|
'com.amazonaws.dynamodb.v20120810#ConditionalCheckFailedException':
|
||||||
|
ConditionalCheckFailedException,
|
||||||
|
'com.amazonaws.dynamodb.v20120810#ItemCollectionSizeLimitExceededException':
|
||||||
|
ItemCollectionSizeLimitExceeded,
|
||||||
'com.amazonaws.dynamodb.v20120810#InternalFailure': InternalFailure,
|
'com.amazonaws.dynamodb.v20120810#InternalFailure': InternalFailure,
|
||||||
'com.amazonaws.dynamodb.v20120810#ProvisionedThroughputExceeded':
|
'com.amazonaws.dynamodb.v20120810#LimitExceededException': LimitExceeded,
|
||||||
|
'com.amazonaws.dynamodb.v20120810#ProvisionedThroughputExceededException':
|
||||||
ThroughputExceeded,
|
ThroughputExceeded,
|
||||||
'com.amazonaws.dynamodb.v20120810#ResourceInUseException': ResourceInUse,
|
'com.amazonaws.dynamodb.v20120810#ResourceInUseException': ResourceInUse,
|
||||||
'com.amazonaws.dynamodb.v20120810#ResourceNotFoundException':
|
'com.amazonaws.dynamodb.v20120810#ResourceNotFoundException':
|
||||||
ResourceNotFound,
|
ResourceNotFound,
|
||||||
|
'com.amazonaws.dynamodb.v20120810#ThrottlingException':
|
||||||
|
ThrottlingException,
|
||||||
'com.amazon.coral.validate#ValidationException': ValidationException
|
'com.amazon.coral.validate#ValidationException': ValidationException
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue