PartnerCentralBenefits / Client / exceptions / ValidationException

ValidationException

class PartnerCentralBenefits.Client.exceptions.ValidationException

Thrown when the request contains invalid parameters or fails input validation requirements.

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': 'unknownOperation'|'cannotParse'|'fieldValidationFailed'|'other'|'BUSINESS_VALIDATION_FAILED',
    'FieldList': [
        {
            'Name': 'string',
            'Message': 'string',
            'Code': 'REQUIRED_FIELD_MISSING'|'INVALID_ENUM_VALUE'|'INVALID_STRING_FORMAT'|'INVALID_VALUE'|'NOT_ENOUGH_VALUES'|'TOO_MANY_VALUES'|'INVALID_RESOURCE_STATE'|'DUPLICATE_KEY_VALUE'|'VALUE_OUT_OF_RANGE'|'ACTION_NOT_PERMITTED'
        },
    ],
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    Thrown when the request contains invalid parameters or fails input validation requirements.

    • Message (string) –

      A message describing the validation error.

    • Reason (string) –

      The reason for the validation failure.

    • FieldList (list) –

      A list of fields that failed validation.

      • (dict) –

        Represents a field-specific validation error with detailed information.

        • Name (string) –

          The name of the field that failed validation.

        • Message (string) –

          A detailed message explaining why the field validation failed.

        • Code (string) –

          An error code explaining why the field validation failed.

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