Skip to content

BlockNotFoundError

Base classes

Name Children Inherits
Exception
builtins
Common base class for all non-exit exceptions.

⋔ Inheritance diagram

graph TD
  94142653858480["environment.BlockNotFoundError"]
  140199010229472["builtins.Exception"]
  140199010230336["builtins.BaseException"]
  140199010283712["builtins.object"]
  140199010229472 --> 94142653858480
  140199010230336 --> 140199010229472
  140199010283712 --> 140199010230336

🛈 DocStrings

Bases: Exception

Exception for not-found template blocks.

Source code in src/jinjarope/environment.py
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
class BlockNotFoundError(Exception):
    """Exception for not-found template blocks."""

    def __init__(
        self,
        block_name: str,
        template_name: str,
        message: str | None = None,
    ):
        """Initialize the exception."""
        self.block_name = block_name
        self.template_name = template_name
        super().__init__(
            message
            or f"Block {self.block_name!r} not found in template {self.template_name!r}",
        )

__init__

__init__(block_name: str, template_name: str, message: str | None = None)

Initialize the exception.

Source code in src/jinjarope/environment.py
636
637
638
639
640
641
642
643
644
645
646
647
648
def __init__(
    self,
    block_name: str,
    template_name: str,
    message: str | None = None,
):
    """Initialize the exception."""
    self.block_name = block_name
    self.template_name = template_name
    super().__init__(
        message
        or f"Block {self.block_name!r} not found in template {self.template_name!r}",
    )

Show source on GitHub