Skip to content

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

Description

@keu

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions