DynamoDB / Client / exceptions / ConditionalCheckFailedException

ConditionalCheckFailedException#

class DynamoDB.Client.exceptions.ConditionalCheckFailedException#

A condition specified in the operation could not be evaluated.

Example

try:
  ...
except client.exceptions.ConditionalCheckFailedException as e:
  print(e.response)
response#

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'Item': {
        'string': {
            'S': 'string',
            'N': 'string',
            'B': b'bytes',
            'SS': [
                'string',
            ],
            'NS': [
                'string',
            ],
            'BS': [
                b'bytes',
            ],
            'M': {
                'string': {'... recursive ...'}
            },
            'L': [
                {'... recursive ...'},
            ],
            'NULL': True|False,
            'BOOL': True|False
        }
    },
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    A condition specified in the operation could not be evaluated.

    • message (string) –

      The conditional request failed.

    • Item (dict) –

      Item which caused the ConditionalCheckFailedException.

      • (string) –

        • (dict) –

          Represents the data for an attribute.

          Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.

          For more information, see Data Types in the Amazon DynamoDB Developer Guide.

          • S (string) –

            An attribute of type String. For example:

            "S": "Hello"

          • N (string) –

            An attribute of type Number. For example:

            "N": "123.45"

            Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

          • B (bytes) –

            An attribute of type Binary. For example:

            "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"

          • SS (list) –

            An attribute of type String Set. For example:

            "SS": ["Giraffe", "Hippo" ,"Zebra"]

            • (string) –

          • NS (list) –

            An attribute of type Number Set. For example:

            "NS": ["42.2", "-19", "7.5", "3.14"]

            Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

            • (string) –

          • BS (list) –

            An attribute of type Binary Set. For example:

            "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]

            • (bytes) –

          • M (dict) –

            An attribute of type Map. For example:

            "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}

            • (string) –

              • (dict) –

                Represents the data for an attribute.

                Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.

                For more information, see Data Types in the Amazon DynamoDB Developer Guide.

          • L (list) –

            An attribute of type List. For example:

            "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]

            • (dict) –

              Represents the data for an attribute.

              Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.

              For more information, see Data Types in the Amazon DynamoDB Developer Guide.

          • NULL (boolean) –

            An attribute of type Null. For example:

            "NULL": true

          • BOOL (boolean) –

            An attribute of type Boolean. For example:

            "BOOL": true

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.