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
| Attribute | Type | Description |
|---|---|---|
| on_enter | Callable[..., 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
| Name | Type | Description |
|---|---|---|
| result | Any | The result of the validation process to be processed upon success |
Returns
| Type | Description |
|---|---|
None | Nothing 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
| Name | Type | Description |
|---|---|---|
| error | [ValidationError](../core/pydantic/core/validationerror.md?sid=pydantic_core__pydantic_core_validationerror) | The validation error object containing details about the failure |
Returns
| Type | Description |
|---|---|
None | Nothing is returned from this callback |
on_exception()
@classmethod
def on_exception(
exception: Exception
) - > None
Callback to be notified of validation exceptions.
Parameters
| Name | Type | Description |
|---|---|---|
| exception | Exception | The exception raised during the validation execution flow |
Returns
| Type | Description |
|---|---|
None | Nothing is returned from this callback |