Merge pull request #263 from tritao/xpcall
Switch 'require' to use xpcall for error handling.
This commit is contained in:
commit
d3d3d9e0a5
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user