Skip to main content

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

AttributeTypeDescription
_errorsSequence[Any]A sequence of validation error objects or messages that occurred during the validation process.
endpoint_ctx`EndpointContextNone`
endpoint_functionAnyThe name of the specific function or method associated with the endpoint that triggered the exception.
endpoint_pathAnyThe URL path or route identifier of the endpoint where the validation error occurred.
endpoint_fileAnyThe filesystem path to the source code file where the endpoint is defined.
endpoint_lineAnyThe 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

NameTypeDescription
errorsSequence[Any]A sequence of validation error details.
endpoint_ctx`EndpointContextNone` = None

Signature

def ValidationException(
errors: Sequence[Any],
endpoint_ctx: EndpointContext | None = None
) - > null

Parameters

NameTypeDescription
errorsSequence[Any]A sequence of error objects or messages that triggered the validation failure
endpoint_ctx`EndpointContextNone` = None

Methods


errors()

@classmethod
def errors() - > Sequence[Any]

Retrieves the sequence of validation errors associated with this exception.

Returns

TypeDescription
Sequence[Any]The collection of error details or messages provided during initialization