Payments / Client / exceptions / ValidationException

ValidationException

class Payments.Client.exceptions.ValidationException

The request isn’t valid. Check reason and fieldList for the cause, correct the request, and try again.

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': 'CANNOT_PARSE'|'FIELD_VALIDATION_FAILED'|'INVALID_PAGINATION_TOKEN'|'UNSUPPORTED_ACTION'|'OTHER',
    'fieldList': [
        {
            'name': 'string',
            'message': 'string'
        },
    ],
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    The request isn’t valid. Check reason and fieldList for the cause, correct the request, and try again.

    • message (string) –

    • reason (string) –

      The reason that validation failed. The following values are valid:

      • CANNOT_PARSE – The request body couldn’t be parsed, or a value isn’t of the expected type.

      • FIELD_VALIDATION_FAILED – One or more members failed validation. fieldList names them.

      • INVALID_PAGINATION_TOKEN – The nextToken is malformed or expired, or doesn’t match the original request. Start again from the first page.

      • UNSUPPORTED_ACTION – The request is well formed, but the action isn’t supported for your account, Region, or resource.

      • OTHER – The request isn’t valid for another reason.

    • fieldList (list) –

      The request members that failed validation. This member is populated when reason is FIELD_VALIDATION_FAILED.

      • (dict) –

        A request member that failed validation.

        • name (string) –

          The name of the request member that failed validation. For a member nested inside another member, the name is a path from the request root, with the segments separated by periods.

        • message (string) –

          A description of why this member failed validation.

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