Log reason why a Lua script fails to parse
This commit is contained in:
@@ -31,9 +31,9 @@ Tick = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
ExecuteSandboxedScript = function(file, contents)
|
ExecuteSandboxedScript = function(file, contents)
|
||||||
local script = loadstring(contents, file)
|
local script, err = loadstring(contents, file)
|
||||||
if (script == nil) then
|
if (script == nil) then
|
||||||
FatalError("Error parsing " .. file)
|
FatalError("Error parsing " .. file .. ". Reason: " .. err)
|
||||||
else
|
else
|
||||||
TryRunSandboxed(script)
|
TryRunSandboxed(script)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user