When using PackageLoader and the template directory does not exist, it throws an error saying:
The 'foobar' package was not installed in a way that PackageLoader understands.
This is clearly incorrect. If the package is actually not there, we get an assertion error. I would say the error should be something like "Template directory was not found in package 'foobar'." or something along those lines.
Describe how to replicate the bug.
Just create a package without the template directory. Try to pass that name of the package to PackageLoader causes the incorrect error to be thrown.
I hope this is not considered too trivial. It did cost me some time to figure out, and only after reading the source code, so I think it's worth changing to something that makes the root cause more apparent.
When using
PackageLoader
and the template directory does not exist, it throws an error saying:This is clearly incorrect. If the package is actually not there, we get an assertion error. I would say the error should be something like "Template directory was not found in package 'foobar'." or something along those lines.
Describe how to replicate the bug. Just create a package without the template directory. Try to pass that name of the package to PackageLoader causes the incorrect error to be thrown.
I hope this is not considered too trivial. It did cost me some time to figure out, and only after reading the source code, so I think it's worth changing to something that makes the root cause more apparent.
Environment: