CloudExtensions / Client / exceptions / ValidationException
ValidationException¶
- class CloudExtensions.Client.exceptions.ValidationException¶
The request was malformed or contained invalid parameter values.
Example
try: ... except client.exceptions.ValidationException as e: print(e.response)
- response¶
The parsed error response. All exceptions have a top level
Errorkey 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'|'UNKNOWN_OPERATION'|'CANNOT_PARSE', 'errors': [ { 'fieldConstraint': { 'field': 'string', 'value': 'string', 'constraint': 'string', 'constraintValuesFrom': [ 'string', ] }, 'semanticError': { 'problem': 'string', 'item': 'string', 'value': 'string' } }, ], 'Error': { 'Code': 'string', 'Message': 'string' } }
Structure
(dict) –
The request was malformed or contained invalid parameter values.
message (string) –
A short summary that is the same for every ValidationException. Read reason and errors for the details.
reason (string) –
A machine-readable classification of the validation failure.
errors (list) –
A list of specific field-level validation errors, when available.
(dict) –
One reason the request failed validation.
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 setSDK_UNKNOWN_MEMBERas the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBERis as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
fieldConstraint (dict) –
A field’s value failed a constraint, such as a length limit or a pattern.
field (string) –
The path of the field that failed validation, with nested members joined by dots, such as
versionPolicy.versionSelector.value (string) –
The value the constraint evaluated: the field’s value, or its length when the constraint is len.
constraint (string) –
The reason why the field’s value is invalid.
constraintValuesFrom (list) –
Where each of the constraint’s values came from, when any was read from another field. Each entry is the path of that field, or a {label} such as {account.maxExtensionSize} for a value the caller doesn’t set.
(string) –
Where one operand came from: a field path, a {label}, or an empty string when the constraint states the value itself.
semanticError (dict) –
The request has a problem that a single constraint doesn’t describe, such as an approve entry that names no capability, or an expired nextToken.
problem (string) –
An uppercase code naming the problem, such as
UNKNOWN_CAPABILITYorREQUIRES_EXACTLY_ONE_MEMBER.item (string) –
The field or item the problem applies to, such as
approveornextToken.value (string) –
The value that caused the problem, when there is one.
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.