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

Error message should state which template raised exception #249

Open
davidchall opened this issue Jul 8, 2022 · 0 comments
Open

Error message should state which template raised exception #249

davidchall opened this issue Jul 8, 2022 · 0 comments

Comments

@davidchall
Copy link

Exceptions have a SourceLocation object, which stores the line and column numbers where the problem was encountered. This produces error messages like:

[inja.exception.render_error] (at 1:10) variable 'name' not found

struct SourceLocation {
size_t line;
size_t column;
};

When using the {% include %} and {% extends %} blocks, these numbers might correspond to a different source file. Therefore, this SourceLocation class should also store the name of the source file. Then the error message could look like:

[inja.exception.render_error] (at 1:10 in header.html) variable 'name' not found

I think this might be a significant quality-of-life improvement, but obviously is not a blocker or bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant