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

Fix error message for non-existing directory #1996

Open
wants to merge 1 commit into
base: 3.1.x
Choose a base branch
from

Conversation

elektito
Copy link

@elektito elektito commented Jun 6, 2024

As described in issue #1995, the error message thrown when the template directory does not exist was very misleading. This is a simple attempt to fix that.

fixes #1995

@davidism
Copy link
Member

davidism commented Jun 6, 2024

This seems even less clear. It doesn't say what package, or what directory name. I'm pretty sure this specific message can happen in other cases too, not just when the directory doesn't exist, so you'll need to split out detection of that and raise a specific error.

@elektito
Copy link
Author

elektito commented Jun 6, 2024

If I understand correctly, in cases where the package/module does not exist, we get an assertion error. So this is left exclusively for cases where the template directory does not exist.

@elektito
Copy link
Author

elektito commented Jun 6, 2024

I could add the package name and template directory to the error message if you think that's better. My reasoning for not including them was that in most cases these are included as strings, so you could see it right in the stack trace.

@elektito
Copy link
Author

elektito commented Jun 6, 2024

I think if there is a case that we can find a package, but cannot find any path associated for it, this can happen too. Not quite sure if that's possible or not. But even in that case, the original error message doesn't make a lot of sense.

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 this pull request may close these issues.

None yet

2 participants