Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jinja2.exceptions.TemplateSyntaxError.source is empty for included files #457

Closed
keu opened this issue Jun 18, 2015 · 0 comments · Fixed by #1112
Closed

jinja2.exceptions.TemplateSyntaxError.source is empty for included files #457

keu opened this issue Jun 18, 2015 · 0 comments · Fixed by #1112
Milestone

Comments

@keu
Copy link

@keu keu commented Jun 18, 2015

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.