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. |