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

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

Add searchpath to TemplateNotFound exception message #1661

tirkarthi opened this issue Apr 28, 2022 · 0 comments

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', '/']
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