Errors
Pydantic固有のエラー
PydanticErrorMixin ¶
PydanticErrorMixin(
message: str, *, code: PydanticErrorCodes | None
)
すべてのPydantic固有のエラーによって共有される共通機能のためのミックスインクラス。
Attributes:
Name | Type | Description |
---|---|---|
message |
エラーを説明するメッセージ。 |
|
code |
PydanticErrorCodes列挙型からのオプションのエラーコード。 |
Source code in pydantic/errors.py
79 80 81 |
|
PydanticUserError ¶
PydanticUserError(
message: str, *, code: PydanticErrorCodes | None
)
Bases: PydanticErrorMixin
, TypeError
Pydanticの使用が正しくないために発生したエラーです。
Source code in pydantic/errors.py
79 80 81 |
|
PydanticUndefinedAnnotation ¶
Bases: PydanticErrorMixin
, NameError
CoreSchema
の生成中に未定義の注釈を処理すると、NameError
のサブクラスが発生します。
Attributes:
Name | Type | Description |
---|---|---|
name |
エラーの名前。 |
|
message |
エラーの説明。 |
Source code in pydantic/errors.py
102 103 104 |
|
from_name_error
classmethod
¶
from_name_error(name_error: NameError) -> Self
NameError
をPydanticUndefinedAnnotation
エラーに変換します。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name_error |
NameError
|
|
required |
Returns:
Type | Description |
---|---|
Self
|
|
Source code in pydantic/errors.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
PydanticImportError ¶
PydanticImportError(message: str)
Bases: PydanticErrorMixin
, ImportError
V1とV2の間でモジュールが変更されたためにインポートが失敗した場合に発生するエラー。
Attributes:
Name | Type | Description |
---|---|---|
message |
エラーの説明。 |
Source code in pydantic/errors.py
130 131 |
|
PydanticSchemaGenerationError ¶
PydanticSchemaGenerationError(message: str)
Bases: PydanticUserError
あるタイプのCoreSchema
の生成に失敗したときに発生したエラー。
Attributes:
Name | Type | Description |
---|---|---|
message |
エラーの説明。 |
Source code in pydantic/errors.py
141 142 |
|
PydanticInvalidForJsonSchema ¶
PydanticInvalidForJsonSchema(message: str)
Bases: PydanticUserError
一部のCoreSchema
のJSONスキーマの生成に失敗したときに発生したエラー。
Attributes:
Name | Type | Description |
---|---|---|
message |
エラーの説明。 |
Source code in pydantic/errors.py
152 153 |
|