Classes
ValidationError
dataclass
A single validation error for a frontmatter field.
ValidationError
dataclass A single validation error for a frontmatter field.
Attributes
| Name | Type | Description |
|---|---|---|
field |
str |
Name of the field that failed validation (e.g., "title", "tags[0]") |
message |
str |
Human-readable error description |
value |
Any |
The actual value that caused the error (for debugging) |
expected_type |
str | None |
Expected type description (e.g., "str", "list[str]") |
Internal Methods 1
__str__
Format error for display.
__str__
def __str__(self) -> str
Format error for display.
Returns
str
ContentValidationError
dataclass
Raised when content fails schema validation.
Provides detailed error information including file lo…
ContentValidationError
dataclass Raised when content fails schema validation.
Provides detailed error information including file location, specific field errors, and suggestions for fixing.
ExceptionAttributes
| Name | Type | Description |
|---|---|---|
message |
str |
Summary error message |
path |
Path |
Path to the content file that failed validation |
errors |
list[ValidationError] |
List of specific field validation errors |
collection_name |
str | None |
Name of the collection (if known) |
Methods 1
to_dict
Convert to dictionary for JSON serialization.
to_dict
def to_dict(self) -> dict[str, Any]
Convert to dictionary for JSON serialization.
Returns
Dictionary with error details suitable for JSON output.dict[str, Any]
—
Internal Methods 3
__post_init__
Initialize Exception with message.
__post_init__
def __post_init__(self) -> None
Initialize Exception with message.
__str__
Format error with file location and field details.
__str__
def __str__(self) -> str
Format error with file location and field details.
Returns
str
__repr__
Detailed repr for debugging.
__repr__
def __repr__(self) -> str
Detailed repr for debugging.
Returns
str
CollectionNotFoundError
Raised when a referenced collection does not exist.
CollectionNotFoundError
Raised when a referenced collection does not exist.
ExceptionAttributes
| Name | Type | Description |
|---|---|---|
collection_name |
— | Name of the missing collection |
available |
— | List of available collection names |
Internal Methods 1
__init__
__init__
def __init__(self, collection_name: str, available: list[str] | None = None)
Parameters 2
collection_name |
str |
|
available |
list[str] | None |
SchemaError
Raised when a schema definition is invalid.
This indicates a problem with how the schema was defin…
SchemaError
Raised when a schema definition is invalid.
This indicates a problem with how the schema was defined, not with the content being validated against it.
ExceptionAttributes
| Name | Type | Description |
|---|---|---|
schema_name |
— | Name of the schema class |
message |
— | Description of the schema problem |
Internal Methods 1
__init__
__init__
def __init__(self, schema_name: str, message: str)
Parameters 2
schema_name |
str |
|
message |
str |