Changes between Version 21 and Version 22 of BetterErrorMessages


Ignore:
Timestamp:
Oct 3, 2008, 11:41:14 AM (16 years ago)
Author:
aneil
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BetterErrorMessages

    v21 v22  
    8989 * See [http://groups.google.com/group/django-developers/browse_thread/thread/42aff5c291a69041/d006eb5292b8aac3 this thread on the django-developers list] for discussion of error suppression in the template engine
    9090
     91== django.template.!__init!__.py ==
     92Using an invalid template tag results in the generic 'list index out of range' error which doesn't show any information about the offending file or expression.  E.g., if a template contains:
     93{{{
     94...
     95{% invalid_template_tag %}
     96...
     97}}}
     98An error occurs at line 279 of django.template.!__init!__.py:
     99{{{
     100278   try:
     101279      compiled_result = compile_func(self, token)
     102280   except KeyError:
     103281      self.invalid_block_tag(token, command)
     104282   except TemplateSyntaxError, e:
     105283      if not self.compile_function_error(token,e):
     106291          raise
     107}}}
     108What seems to be happening is that self.invalid_block_tag(...) raises an error which gets caught by TemplateSyntaxError and which eventually leads to the generic 'list index out of range' error being reported in the Django error page.
    91109
    92110== FIXED ==
Back to Top