Log the path and error when a custom dll fails to load

The log named only the folder. It now names the dll and the load error, or
says the folder has no dll.
This commit is contained in:
Michael Robles authored and Michał Lewandowski committed 2026-11-12 19:01:05 +01:00
1 parent 2683a00dfa
commit 5f69a25d60
1 file changed
+11 -1
+11 -1
View File
@@ -184,7 +184,17 @@ inline Exports Load(const std::string& name, Kind kind)
if (dll == nullptr)
{
LOG_ERROR("Can't load custom {} from {}", name, wstring_to_string(Folder(name).wstring()));
if (path.empty())
{
LOG_ERROR("Can't load custom {}: no dll in {}", name, wstring_to_string(Folder(name).wstring()));
return {};
}
// ERROR_DLL_INIT_FAILED: the dll refused to load, e.g. a provider that needs another module loaded first
const DWORD error = GetLastError();
LOG_ERROR("Can't load custom {} from {}, error {}{}", name, wstring_to_string(path.wstring()), error,
error == ERROR_DLL_INIT_FAILED ? " (the dll refused to load; it needs something this process lacks)"
: "");
return {};
}