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, message=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: from ._compat import imap
  from ._compat import implements_to_string
  from ._compat import PY2
  from ._compat import text_type
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)