Module

parser.blocks.error_handling

Error boundary block parsing for Kida parser.

Provides mixin for parsing {% try %}...{% fallback %}...{% end %} blocks.

Uses inline TYPE_CHECKING declarations for host attributes. See: plan/rfc-mixin-protocol-typing.md

Classes

ErrorHandlingBlockParsingMixin 1
Mixin for parsing error boundary blocks. Host attributes and cross-mixin dependencies are declared…

Mixin for parsing error boundary blocks.

Host attributes and cross-mixin dependencies are declared via inline TYPE_CHECKING blocks.

Methods

Internal Methods 1
_parse_try 0 Try
Parse {% try %}...{% fallback [name] %}...{% end %}. Error boundary that catch…
def _parse_try(self) -> Try

Parse {% try %}...{% fallback [name] %}...{% end %}.

Error boundary that catches rendering errors in the body and renders fallback content instead. An optional name after {% fallback %} binds the caught error as a dict to the fallback scope.

Returns
Try