Make error message in require more descriptive for custom LOVE library loader.#1865
Make error message in require more descriptive for custom LOVE library loader.#1865MikuAuahDark wants to merge 1 commit into
Conversation
| Filesystem::Info info = {}; | ||
| if (!inst->getInfo(element.c_str(), info) || info.type == Filesystem::FILETYPE_DIRECTORY) | ||
| { | ||
| errstr << "\n\t tried '" << element << "' in save directory"; |
There was a problem hiding this comment.
I think this isn't guaranteed to only look (or work) in the save directory right now, especially if love 12's new mount APIs have been used.
There was a problem hiding this comment.
What would be a good replacement text for those?
There was a problem hiding this comment.
Maybe it could be something like this for the Lua loader:
No Lua code 'path/to/module' in LOVE filesystem paths:
tried 'path/to/module.lua'
And for the C module loader:
No C library 'path/to/module' in LOVE filesystem paths:
tried 'path/to/module.dll'
Does that make sense? I haven't thought about this too hard. Maybe the language could still be tweaked a bit...
There was a problem hiding this comment.
For the C module paths, I was thinking of resolving the fullpath then printing the absolute path, but then I realize PHYSFS_getRealDir only works when the file is there (which most likely succeeded when this codepath is reached, defeating the purpose).
This PR adds paths that LOVE tried to load when
requirefails in the error message.The new output will look like this:
Fixes #1864