Skip to content

BlockNotFoundError

Base classes

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

⋔ Inheritance diagram

graph TD
  94892546050000["environment.BlockNotFoundError"]
  140247609523424["builtins.Exception"]
  140247609524288["builtins.BaseException"]
  140247609577664["builtins.object"]
  140247609523424 --> 94892546050000
  140247609524288 --> 140247609523424
  140247609577664 --> 140247609524288

🛈 DocStrings

Bases: Exception

Exception for not-found template blocks.

Source code in src/jinjarope/environment.py
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
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
823
824
825
826
827
828
829
830
831
832
833
834
835
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