Skip to content

BlockNotFoundError

Base classes

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

⋔ Inheritance diagram

graph TD
  94173637899888["environment.BlockNotFoundError"]
  139866057989376["builtins.Exception"]
  139866057990240["builtins.BaseException"]
  139866058043616["builtins.object"]
  139866057989376 --> 94173637899888
  139866057990240 --> 139866057989376
  139866058043616 --> 139866057990240

🛈 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