ValidationException
This class represents an exception raised when data validation fails, capturing a sequence of specific errors and optional endpoint context. It provides detailed information about the location of the failure, including the endpoint path, file, line number, and function name. The class formats these details into a structured string representation to assist with debugging validation issues.
Attributes
| Attribute | Type | Description |
|---|---|---|
| _errors | Sequence[Any] | A sequence of validation error objects or messages that occurred during the validation process. |
| endpoint_ctx | `EndpointContext | None` |
| endpoint_function | Any | The name of the specific function or method associated with the endpoint that triggered the exception. |
| endpoint_path | Any | The URL path or route identifier of the endpoint where the validation error occurred. |
| endpoint_file | Any | The filesystem path to the source code file where the endpoint is defined. |
| endpoint_line | Any | The specific line number in the source file where the endpoint logic is located. |
Constructor
Signature
def ValidationException(
errors: Sequence[Any],
endpoint_ctx: EndpointContext | None = None
) - > None
Parameters
| Name | Type | Description |
|---|---|---|
| errors | Sequence[Any] | A sequence of validation error details. |
| endpoint_ctx | `EndpointContext | None` = None |
Signature
def ValidationException(
errors: Sequence[Any],
endpoint_ctx: EndpointContext | None = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| errors | Sequence[Any] | A sequence of error objects or messages that triggered the validation failure |
| endpoint_ctx | `EndpointContext | None` = None |
Methods
errors()
@classmethod
def errors() - > Sequence[Any]
Retrieves the sequence of validation errors associated with this exception.
Returns
| Type | Description |
|---|---|
Sequence[Any] | The collection of error details or messages provided during initialization |