Merge pull request #263 from tritao/xpcall

Switch 'require' to use xpcall for error handling.
This commit is contained in:
starkos 2015-09-12 14:37:17 -04:00
commit d3d3d9e0a5

View File

@ -74,10 +74,7 @@
---
premake.override(_G, "require", function(base, modname, versions)
local result, mod = pcall(base,modname)
if not result then
error( mod, 3 )
end
local result, mod = xpcall(base(modname), debug.traceback)
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)