| | 91 | == django.template.!__init!__.py == |
| | 92 | 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: |
| | 93 | {{{ |
| | 94 | ... |
| | 95 | {% invalid_template_tag %} |
| | 96 | ... |
| | 97 | }}} |
| | 98 | An error occurs at line 279 of django.template.!__init!__.py: |
| | 99 | {{{ |
| | 100 | 278 try: |
| | 101 | 279 compiled_result = compile_func(self, token) |
| | 102 | 280 except KeyError: |
| | 103 | 281 self.invalid_block_tag(token, command) |
| | 104 | 282 except TemplateSyntaxError, e: |
| | 105 | 283 if not self.compile_function_error(token,e): |
| | 106 | 291 raise |
| | 107 | }}} |
| | 108 | 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. |