Skip to main content

CustomErrorValidator

No overview available.

Attributes

AttributeTypeDescription
validatorArc< CombinedValidator >The underlying combined validator instance used to perform the core validation logic.
custom_error[CustomError](customerror.md?sid=validators_custom_error_customerror)The specific error definition to be returned when the validation process fails.
nameStringThe identifier string used to represent this specific validator instance within the system.

Constructor

Signature

def CustomErrorValidator(
validator: Arc< CombinedValidator >,
custom_error: [CustomError](customerror.md?sid=validators_custom_error_customerror),
name: String
) - > [CustomErrorValidator](customerrorvalidator.md?sid=validators_custom_error_customerrorvalidator)

Parameters

NameTypeDescription
validatorArc< CombinedValidator >The underlying validator to be wrapped.
custom_error[CustomError](customerror.md?sid=validators_custom_error_customerror)The custom error details to be returned when validation fails.
nameStringThe name associated with this validator instance.

Signature

@staticmethod
def new(
validator: Arc< CombinedValidator >,
custom_error: [CustomError](customerror.md?sid=validators_custom_error_customerror),
name: String
) - > [CustomErrorValidator](customerrorvalidator.md?sid=validators_custom_error_customerrorvalidator)

Parameters

NameTypeDescription
validatorArc< CombinedValidator >The underlying validation logic to be executed.
custom_error[CustomError](customerror.md?sid=validators_custom_error_customerror)The specific error structure to return if the validation fails.
nameStringA unique identifier or label for this validator instance used in reporting.