Module

errors

Exception classes for Patitas.

Provides standardized exceptions for error handling throughout Patitas.

Classes

PatitasError 0
Base exception for all Patitas errors. Subclass this for specific error categories.

Base exception for all Patitas errors.

Subclass this for specific error categories.

ParseError 1
Error during Markdown parsing. Raised when the parser encounters invalid or unexpected input.

Error during Markdown parsing.

Raised when the parser encounters invalid or unexpected input.

Methods

Internal Methods 1
__init__ 4
Initialize parse error with optional location.
def __init__(self, message: str, lineno: int | None = None, col_offset: int | None = None, source_file: str | None = None) -> None
Parameters
Name Type Description
message

Error description

lineno

Line number where error occurred (1-indexed)

Default:None
col_offset

Column offset where error occurred (1-indexed)

Default:None
source_file

Path to source file (optional)

Default:None
DirectiveContractError 1
Error when a directive contract is violated. Raised when directive options don't meet requirements…

Error when a directive contract is violated.

Raised when directive options don't meet requirements or content doesn't match expected structure.

Methods

Internal Methods 1
__init__ 3
Initialize directive contract error.
def __init__(self, directive_name: str, message: str, lineno: int | None = None) -> None
Parameters
Name Type Description
directive_name

Name of the directive (e.g., "note", "code-tabs")

message

Description of the contract violation

lineno

Line number where directive started (optional)

Default:None
RenderError 0
Error during HTML rendering. Raised when the renderer encounters an invalid AST node or fails to p…

Error during HTML rendering.

Raised when the renderer encounters an invalid AST node or fails to produce valid output.

PluginError 1
Error in plugin initialization or execution. Raised when a plugin fails to register or process con…

Error in plugin initialization or execution.

Raised when a plugin fails to register or process content.

Methods

Internal Methods 1
__init__ 2
Initialize plugin error.
def __init__(self, plugin_name: str, message: str) -> None
Parameters
Name Type Description
plugin_name

Name of the failing plugin

message

Description of the error