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

Better jinja errors #1829

Closed
plaindocs opened this issue Oct 21, 2022 · 5 comments · Fixed by #1833
Closed

Better jinja errors #1829

plaindocs opened this issue Oct 21, 2022 · 5 comments · Fixed by #1833

Comments

@plaindocs
Copy link
Contributor

@ericholscher @mxsasha Can we add a file and line number to these errors?

Handler <function render_rst_with_jinja at 0x7f08a08b6b00> for event 'source-read' threw an exception (exception: 'unconf' is undefined)
@ericholscher
Copy link
Member

Maybe. It's almost certainly coming from the conf.py, but guessing it's run in some undefined context.

@plaindocs
Copy link
Contributor Author

Most likely to be in load_conference_context_from_yaml in _ext/core.py after @mxsasha 's refactor a while back?

@mxsasha
Copy link
Contributor

mxsasha commented Oct 25, 2022

Do you have an example of a build that failed on this? Then I can mess around with it and see if we can print more context. Looked through some recent failures but did not see this type.

@plaindocs
Copy link
Contributor Author

I thought it was one of the recent broken ones in the Australia PR, but all I'm getting now is this

Handler <function render_rst_with_jinja at 0x7fc53fd82b00> for event 'source-read' threw an exception (exception: include/schedule2022.rst)

in 0908bf2

@mxsasha
Copy link
Contributor

mxsasha commented Oct 27, 2022

I can't reproduce that last one, as the branch is gone.

For the initial error about unconf being undefined: #1833. Line numbers are not available in the error.
The root cause here is that our YAML validator is quite flexible, to allow historical YAML files too. We could make a separate schema for newer files, or just make a stricter schema and only validate newer files, as the old ones don't really change.

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

Successfully merging a pull request may close this issue.

3 participants