Fixed package module to propagate erros from loading module

This commit is contained in:
Wobbo 2014-01-27 13:09:25 +01:00
parent ee239fb3e2
commit a0b5f3ef53

View File

@ -58,7 +58,12 @@ end
local function pathSearcher(module) local function pathSearcher(module)
local filepath, reason = package.searchpath(module, package.path) local filepath, reason = package.searchpath(module, package.path)
if filepath then if filepath then
return loadfile(filepath, "bt", _G), filepath local loader, reason = loadfile(filepath, "bt", _G), filepath
if loader then
return loader, filepath
else
return reason
end
else else
return reason return reason
end end