class_docstr: Raised if a template does not exist.
  
  .. versionchanged:: 2.11
      If the given name is :class:`Undefined` and no message was
      provided, an :exc:`UndefinedError` is raised.
class_docstr_tok: ["Raised","if","a","template","does","not","exist",".","..","versionchanged",":",":","2.11","If","the","given","name","is",":","class",":","`","Undefined","`","and","no","message","was","provided",",","an",":","exc",":","`","UndefinedError","`","is","raised","."]
code: def __init__(
      self,
      name: t.Optional[t.Union[str, "Undefined"]],
      message: t.Optional[str] = None,
  ) -> None:
      IOError.__init__(self, name)
  
      if message is None:
          from .runtime import Undefined
  
          if isinstance(name, Undefined):
              name._fail_with_undefined_error()
  
          message = name
  
      self.message = message
      self.name = name
      self.templates = [name]
  
imports: import typing
label_desc: Use image node_id 1 to create a new TemplateNotFound object from inherited base classes: IOError, LookupError, TemplateError with example: obj = TemplateNotFound(name, message)