Errors
Pydantic-specific errors.
PydanticErrorMixin
Section titled “PydanticErrorMixin”A mixin class for common functionality shared by all Pydantic-specific errors.
Attributes
Section titled “Attributes”message
Section titled “message”A message describing the error.
An optional error code from PydanticErrorCodes enum.
PydanticUserError
Section titled “PydanticUserError”Bases: PydanticErrorMixin, RuntimeError
An error raised due to incorrect use of Pydantic.
PydanticUndefinedAnnotation
Section titled “PydanticUndefinedAnnotation”Bases: PydanticErrorMixin, NameError
A subclass of NameError raised when handling undefined annotations during CoreSchema generation.
Attributes
Section titled “Attributes”Name of the error.
message
Section titled “message”Description of the error.
Methods
Section titled “Methods”from_name_error
Section titled “from_name_error”@classmethod
def from_name_error(cls, name_error: NameError) -> SelfConvert a NameError to a PydanticUndefinedAnnotation error.
Returns
Section titled “Returns”Self -- Converted PydanticUndefinedAnnotation error.
Parameters
Section titled “Parameters”name_error : NameError
NameError to be converted.
PydanticImportError
Section titled “PydanticImportError”Bases: PydanticErrorMixin, ImportError
An error raised when an import fails due to module changes between V1 and V2.
Attributes
Section titled “Attributes”message
Section titled “message”Description of the error.
PydanticSchemaGenerationError
Section titled “PydanticSchemaGenerationError”Bases: PydanticUserError
An error raised during failures to generate a CoreSchema for some type.
Attributes
Section titled “Attributes”message
Section titled “message”Description of the error.
PydanticInvalidForJsonSchema
Section titled “PydanticInvalidForJsonSchema”Bases: PydanticUserError
An error raised during failures to generate a JSON schema for some CoreSchema.
Attributes
Section titled “Attributes”message
Section titled “message”Description of the error.
PydanticForbiddenQualifier
Section titled “PydanticForbiddenQualifier”Bases: PydanticUserError
An error raised if a forbidden type qualifier is found in a type annotation.