I have tried to make Jinja's error messages better and more useful for template writers.
Catching the jinja2.exceptions.TemplateSyntaxError exception gives me the all information I need:
- template source, i.e. - filename
- line number
- error message
- template source
But if the error occurs in nested template (included with {% include 'nested.txt' %}), the source is empty.
Is there any reason why this happens?
I have tried to make Jinja's error messages better and more useful for template writers.
Catching the jinja2.exceptions.TemplateSyntaxError exception gives me the all information I need:
But if the error occurs in nested template (included with {% include 'nested.txt' %}), the source is empty.
Is there any reason why this happens?