class_docstr: Raised to tell the user that there is a problem with the template.
class_docstr_tok: ["Raised","to","tell","the","user","that","there","is","a","problem","with","the","template","."]
code: def __str__(self):
      # for translated errors we only return the message
      if self.translated:
          return self.message
  
      # otherwise attach some stuff
      location = "line %d" % self.lineno
      name = self.filename or self.name
      if name:
          location = 'File "%s", %s' % (name, location)
      lines = [self.message, "  " + location]
  
      # if the source is set, add the line to the output
      if self.source is not None:
          try:
              line = self.source.splitlines()[self.lineno - 1]
          except IndexError:
              line = None
          if line:
              lines.append("    " + line.strip())
  
      return "\n".join(lines)
  
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 2 for calling the TemplateSyntaxError obj's underlying member method code with example usage: obj.__str__() and returns: str, self