Skip to main content

BaseValidateHandlerProtocol

Base class for plugin callbacks protocols. You shouldn't implement this protocol directly, instead use one of the subclasses with adds the correctly typed on_error method.

Attributes

AttributeTypeDescription
on_enterCallable[..., None]on_enter is changed to be more specific on all subclasses

Methods


on_success()

@classmethod
def on_success(
result: Any
) - > None

Callback to be notified of successful validation.

Parameters

NameTypeDescription
resultAnyThe result of the validation process to be processed upon success

Returns

TypeDescription
NoneNothing is returned from this callback

on_error()

@classmethod
def on_error(
error: [ValidationError](../core/pydantic/core/validationerror.md?sid=pydantic_core__pydantic_core_validationerror)
) - > None

Callback to be notified of validation errors.

Parameters

NameTypeDescription
error[ValidationError](../core/pydantic/core/validationerror.md?sid=pydantic_core__pydantic_core_validationerror)The validation error object containing details about the failure

Returns

TypeDescription
NoneNothing is returned from this callback

on_exception()

@classmethod
def on_exception(
exception: Exception
) - > None

Callback to be notified of validation exceptions.

Parameters

NameTypeDescription
exceptionExceptionThe exception raised during the validation execution flow

Returns

TypeDescription
NoneNothing is returned from this callback