Open elektito opened 1 month ago
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.
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.
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.
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.
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