AppConfigCloudExtension / Client / exceptions / ValidationException

ValidationException

class AppConfigCloudExtension.Client.exceptions.ValidationException

The request does not fit the operation’s model. The message describes every failure and may change; read reason and errors to act on them.

Example

try:
  ...
except client.exceptions.ValidationException 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',
    'reason': 'FIELD_VALIDATION_FAILED'|'CANNOT_PARSE'|'UNKNOWN_OPERATION',
    'errors': [
        {
            'fieldConstraint': {
                'field': 'string',
                'value': 'string',
                'constraint': {
                    'required': True|False,
                    'type': {
                        'expected': 'string'
                    },
                    'length': {
                        'min': 123,
                        'max': 123,
                        'tested': 123
                    },
                    'range': {
                        'min': 123.0,
                        'max': 123.0
                    },
                    'pattern': {
                        'pattern': 'string'
                    },
                    'enum': {
                        'allowed': [
                            'string',
                        ]
                    },
                    'union': True|False
                }
            },
            'semanticError': {
                'problem': 'string',
                'item': 'string',
                'value': 'string'
            }
        },
    ],
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    The request does not fit the operation’s model. The message describes every failure and may change; read reason and errors to act on them.

    • message (string) –

      A description of the error.

    • reason (string) –

      Why the request is invalid.

    • errors (list) –

      The failures, when reason is FIELD_VALIDATION_FAILED. A configuration or flag that doesn’t exist is a semanticError with problem RESOURCE_NOT_FOUND or FLAG_NOT_FOUND.

      • (dict) –

        One validation failure: either a constraint a member failed, or a semantic error.

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: fieldConstraint, semanticError. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • fieldConstraint (dict) –

          A member’s value failed a constraint the model declares.

          • field (string) –

            The member’s path from the input: a.b for a nested member, a[0] for a list element, a[key] for a map value.

          • value (string) –

            The value as sent. It is omitted for a missing member, a length or union failure, and a @sensitive member.

          • constraint (dict) –

            The constraint the value failed.

            Note

            This is a Tagged Union structure. Only one of the following top level keys will be set: required, type, length, range, pattern, enum, union. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
            
            • required (boolean) –

              The member is @required and missing. Always true when set.

            • type (dict) –

              The value is not the member’s type.

              • expected (string) –

                The Smithy type the value must have, such as integer or timestamp.

            • length (dict) –

              The value’s length is outside @length.

              • min (integer) –

                The shortest length allowed.

              • max (integer) –

                The longest length allowed.

              • tested (integer) –

                The value’s length.

            • range (dict) –

              The value is outside @range.

              • min (float) –

                The smallest value allowed.

              • max (float) –

                The largest value allowed.

            • pattern (dict) –

              The value doesn’t match @pattern.

              • pattern (string) –

                The pattern the value must match.

            • enum (dict) –

              The value is not one of the enum’s values.

              • allowed (list) –

                The values allowed.

                • (string) –

            • union (boolean) –

              The union sets no member or more than one. Always true when set.

        • semanticError (dict) –

          A request the Extension refused for a reason of its own.

          • problem (string) –

            An UPPER_SNAKE code for what was wrong.

          • item (string) –

            The member or item the problem concerns.

          • value (string) –

            The value the problem concerns.

    • 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.