Changes between Version 58 and Version 59 of BetterErrorMessages


Ignore:
Timestamp:
Mar 1, 2014, 12:57:14 AM (10 years ago)
Author:
ANUBHAV JOSHI
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BetterErrorMessages

    v58 v59  
    130130
    131131* See [http://groups.google.com/group/django-developers/browse_thread/thread/42aff5c291a69041/d006eb5292b8aac3 this thread on the django-developers list] for discussion of suppression of TypeError in the template engine.
    132 
    133 
    134 == django.template.!__init!__.py ==
    135 Using 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:
    136 {{{
    137 ...
    138 {% invalid_template_tag %}
    139 ...
    140 }}}
    141 An error occurs at line 279 of django.template.!__init!__.py:
    142 {{{
    143 278   try:
    144 279      compiled_result = compile_func(self, token)
    145 280   except KeyError:
    146 281      self.invalid_block_tag(token, command)
    147 282   except TemplateSyntaxError, e:
    148 283      if not self.compile_function_error(token,e):
    149 291          raise
    150 }}}
    151 What 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.
Back to Top