diff --git a/src/_premake_main.lua b/src/_premake_main.lua index 93589f22..355aebd2 100644 --- a/src/_premake_main.lua +++ b/src/_premake_main.lua @@ -68,6 +68,9 @@ if chunk then return chunk end + if err then + return "\n\tload error " .. err + end end end diff --git a/src/base/globals.lua b/src/base/globals.lua index 89911b57..cec61615 100644 --- a/src/base/globals.lua +++ b/src/base/globals.lua @@ -74,7 +74,10 @@ --- premake.override(_G, "require", function(base, modname, versions) - local mod = base(modname) + local result, mod = pcall(base,modname) + if not result then + error( mod, 3 ) + end if mod and versions and not premake.checkVersion(mod._VERSION, versions) then error(string.format("module %s %s does not meet version criteria %s", modname, mod._VERSION or "(none)", versions), 3)