InfoDump: Do not crash if one plugin fails to load.
If there's a syntax error in one plugin's Info.lua file, report the error and continue processing.
This commit is contained in:
parent
b025bb63c2
commit
d79d5945e3
@ -625,7 +625,11 @@ local function LoadPluginInfo(a_FolderName)
|
||||
-- This is Lua-5.1-specific and won't work in Lua 5.2!
|
||||
local Sandbox = {}
|
||||
setfenv(cfg, Sandbox)
|
||||
cfg()
|
||||
local isSuccess, errMsg = pcall(cfg)
|
||||
if not(isSuccess) then
|
||||
return nil, "Cannot load Info.lua: " .. (errMsg or "<unknown error>")
|
||||
end
|
||||
|
||||
if (Sandbox.g_PluginInfo == nil) then
|
||||
return nil, "Info.lua doesn't contain the g_PluginInfo declaration"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user