U nf@sdZddlmZddlZddlmZmZddlm Z ddl m Z dZ d e d Z ed ZGd d d ZGdddeeZGdddeeZGdddeeZGdddeZGdddeZe eZdS)zPydantic-specific errors.) annotationsN)LiteralSelf)getattr_migration) version_short)PydanticUserErrorPydanticUndefinedAnnotationPydanticImportErrorPydanticSchemaGenerationErrorPydanticInvalidForJsonSchemaPydanticErrorCodeszhttps://errors.pydantic.dev/z/u/)*zclass-not-fully-definedzcustom-json-schemazdecorator-missing-fieldzdiscriminator-no-fieldzdiscriminator-alias-typezdiscriminator-needs-literalzdiscriminator-aliaszdiscriminator-validatorzcallable-discriminator-no-tagztyped-dict-versionzmodel-field-overriddenzmodel-field-missing-annotationz config-bothzremoved-kwargsinvalid-for-json-schemazjson-schema-already-usedzbase-model-instantiatedundefined-annotationschema-for-unknown-type import-errorzcreate-model-field-definitionszcreate-model-config-basezvalidator-no-fieldszvalidator-invalid-fieldszvalidator-instance-methodzroot-validator-pre-skipz model-serializer-instance-methodzvalidator-field-config-infozvalidator-v1-signaturezvalidator-signaturezfield-serializer-signaturezmodel-serializer-signaturezmultiple-field-serializersZinvalid_annotated_typeztype-adapter-config-unusedzroot-model-extrazunevaluable-type-annotationz dataclass-init-false-extra-allowzclashing-init-and-init-varzmodel-config-invalid-field-namezwith-config-on-modelzdataclass-on-modelc@s0eZdZdZddddddZddd d Zd 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. strzPydanticErrorCodes | NoneNone)messagecodereturncCs||_||_dS)Nrr)selfrrr=/opt/hc_python/lib/python3.8/site-packages/pydantic/errors.py__init__OszPydanticErrorMixin.__init__)rcCs*|jdkr|jS|jdt|jSdS)Nz For further information visit )rrDEV_ERROR_DOCS_URL)rrrr__str__Ss zPydanticErrorMixin.__str__N)__name__ __module__ __qualname____doc__rrrrrrrGsrc@seZdZdZdS)rz1An error raised due to incorrect use of Pydantic.N)rr r!r"rrrrrZsrcs>eZdZdZddddfdd Zeddd d d ZZS) r zA subclass of `NameError` raised when handling undefined annotations during `CoreSchema` generation. Attributes: name: Name of the error. message: Description of the error. rr)namerrcs||_tj|dddS)Nrr)r#superr)rr#r __class__rrrfsz$PydanticUndefinedAnnotation.__init__ NameErrorr) name_errorrcCsFz |j}Wn*tk r4tdt|d}YnX||t|dS)zConvert a `NameError` to a `PydanticUndefinedAnnotation` error. Args: name_error: `NameError` to be converted. Returns: Converted `PydanticUndefinedAnnotation` error. z .*'(.+?)'r)r#r)r#AttributeErrorresearchrgroup)clsr(r#rrrfrom_name_errorjs  z+PydanticUndefinedAnnotation.from_name_error)rr r!r"r classmethodr. __classcell__rrr%rr ^sr cs(eZdZdZdddfdd ZZS)r zAn error raised when an import fails due to module changes between V1 and V2. Attributes: message: Description of the error. rrrrcstj|dddS)Nrrr$rrrr%rrrszPydanticImportError.__init__rr r!r"rr0rrr%rr {sr cs(eZdZdZdddfdd ZZS)r zAn error raised during failures to generate a `CoreSchema` for some type. Attributes: message: Description of the error. rrr1cstj|dddS)Nrr2r3r4r%rrrsz&PydanticSchemaGenerationError.__init__r5rrr%rr sr cs(eZdZdZdddfdd ZZS)r zAn error raised during failures to generate a JSON schema for some `CoreSchema`. Attributes: message: Description of the error. rrr1cstj|dddS)Nrr2r3r4r%rrrsz%PydanticInvalidForJsonSchema.__init__r5rrr%rr sr )r" __future__rZ _annotationsr*typing_extensionsrrZ _migrationrversionr__all__rr r TypeErrorrr'r ImportErrorr r r r __getattr__rrrrs"    .