o
    Rh                     @  s   d Z ddlmZ ddlZddlmZmZ ddlm	Z	 ddl
mZ dZd	e  d
Zed ZG dd dZG dd deeZG dd deeZG dd deeZG dd deZG dd deZe	eZdS )zPydantic-specific errors.    )annotationsN)LiteralSelf   )getattr_migration)version_short)PydanticUserErrorPydanticUndefinedAnnotationPydanticImportErrorPydanticSchemaGenerationErrorPydanticInvalidForJsonSchemaPydanticErrorCodeszhttps://errors.pydantic.dev/z/u/)+zclass-not-fully-definedzcustom-json-schemazdecorator-missing-fieldzdiscriminator-no-fieldzdiscriminator-alias-typezdiscriminator-needs-literalzdiscriminator-aliaszdiscriminator-validatorzcallable-discriminator-no-tagztyped-dict-versionzmodel-field-overriddenzmodel-field-missing-annotationzconfig-bothzremoved-kwargsinvalid-for-json-schemazjson-schema-already-usedzbase-model-instantiatedundefined-annotationschema-for-unknown-typeimport-errorzcreate-model-field-definitionszcreate-model-config-basezvalidator-no-fieldszvalidator-invalid-fieldszvalidator-instance-methodzvalidator-input-typezroot-validator-pre-skipz model-serializer-instance-methodzvalidator-field-config-infozvalidator-v1-signaturezvalidator-signaturezfield-serializer-signaturezmodel-serializer-signaturezmultiple-field-serializerszinvalid-annotated-typeztype-adapter-config-unusedzroot-model-extrazunevaluable-type-annotationz dataclass-init-false-extra-allowzclashing-init-and-init-varzmodel-config-invalid-field-namezwith-config-on-modelzdataclass-on-modelc                   @  s$   e Zd ZdZddd	Zdd
dZdS )PydanticErrorMixinzA mixin class for common functionality shared by all Pydantic-specific errors.

    Attributes:
        message: A message describing the error.
        code: An optional error code from PydanticErrorCodes enum.
    messagestrcodePydanticErrorCodes | NonereturnNonec                C  s   || _ || _d S )Nr   r   )selfr   r    r   Q/home/air/sanwanet/backup_V2/venv/lib/python3.10/site-packages/pydantic/errors.py__init__P   s   
zPydanticErrorMixin.__init__c                 C  s&   | j d u r| jS | j dt | j  S )Nz 

For further information visit )r   r   DEV_ERROR_DOCS_URL)r   r   r   r   __str__T   s   
zPydanticErrorMixin.__str__N)r   r   r   r   r   r   )r   r   )__name__
__module____qualname____doc__r   r   r   r   r   r   r   H   s    
r   c                   @  s   e Zd ZdZdS )r   z1An error raised due to incorrect use of Pydantic.N)r    r!   r"   r#   r   r   r   r   r   [   s    r   c                      s0   e Zd ZdZd fddZedddZ  ZS )r	   zA subclass of `NameError` raised when handling undefined annotations during `CoreSchema` generation.

    Attributes:
        name: Name of the error.
        message: Description of the error.
    namer   r   r   r   c                   s   || _ t j|dd d S )Nr   r   )r$   superr   )r   r$   r   	__class__r   r   r   g   s   z$PydanticUndefinedAnnotation.__init__
name_error	NameErrorr   c                 C  sD   z|j }W n ty   tdt|d}Y nw | |t|dS )zConvert a `NameError` to a `PydanticUndefinedAnnotation` error.

        Args:
            name_error: `NameError` to be converted.

        Returns:
            Converted `PydanticUndefinedAnnotation` error.
        z	.*'(.+?)'r   )r$   r   )r$   AttributeErrorresearchr   group)clsr(   r$   r   r   r   from_name_errork   s   

z+PydanticUndefinedAnnotation.from_name_error)r$   r   r   r   r   r   )r(   r)   r   r   )r    r!   r"   r#   r   classmethodr/   __classcell__r   r   r&   r   r	   _   s
    r	   c                      "   e Zd ZdZd fddZ  ZS )	r
   zAn error raised when an import fails due to module changes between V1 and V2.

    Attributes:
        message: Description of the error.
    r   r   r   r   c                      t  j|dd d S )Nr   r   r%   r   r   r   r&   r   r   r         zPydanticImportError.__init__r   r   r   r   r    r!   r"   r#   r   r1   r   r   r&   r   r
   |       r
   c                      r2   )	r   zAn error raised during failures to generate a `CoreSchema` for some type.

    Attributes:
        message: Description of the error.
    r   r   r   r   c                   r3   )Nr   r4   r5   r6   r&   r   r   r      r7   z&PydanticSchemaGenerationError.__init__r8   r9   r   r   r&   r   r      r:   r   c                      r2   )	r   zAn error raised during failures to generate a JSON schema for some `CoreSchema`.

    Attributes:
        message: Description of the error.
    r   r   r   r   c                   r3   )Nr   r4   r5   r6   r&   r   r   r      r7   z%PydanticInvalidForJsonSchema.__init__r8   r9   r   r   r&   r   r      r:   r   )r#   
__future__r   _annotationsr+   typing_extensionsr   r   
_migrationr   versionr   __all__r   r   r   	TypeErrorr   r)   r	   ImportErrorr
   r   r   r    __getattr__r   r   r   r   <module>   s$    /