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

Add searchpath to TemplateNotFound exception message #1661

Closed
tirkarthi opened this issue Apr 28, 2022 · 0 comments
Closed

Add searchpath to TemplateNotFound exception message #1661

tirkarthi opened this issue Apr 28, 2022 · 0 comments
Milestone

Comments

@tirkarthi
Copy link

This was from apache/airflow#23333 where trying to load a template that doesn't exist in the searchpath raises TemplateNotFound exception. In this case an absolute path is used which causes issue over concatenation but including searchpath might be a useful addition so that user can know under the paths under which the template was searched for and will be helpful during debugging.

raise TemplateNotFound(template)

Current exception :

jinja2.exceptions.TemplateNotFound: /tmp/a/python_template_exts.txt

Proposed exception to include searchpath :

jinja2.exceptions.TemplateNotFound: /tmp/a/python_template_exts.txt not found in search path ['/opt/airflow/tests/operators', '/']
@davidism davidism added this to the 3.1.5 milestone Dec 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants