fix: show the error if can't find the executable file (mod:dofile)

This commit is contained in:
Unknown 2018-03-05 23:03:33 +03:00 committed by bi
parent 1bf9822098
commit c861e19f2e

View file

@ -158,9 +158,13 @@ VMFMod.dofile = function (self, script_path)
local success, values = pack_pcall(pcall(dofile, script_path)) local success, values = pack_pcall(pcall(dofile, script_path))
if not success then if not success then
self:error("(loadfile): %s", values[1].error)
print("\nTRACEBACK:\n\n" .. tostring(values[1].traceback) .. "\nLOCALS:\n\n" .. tostring(values[1].locals)) if values[1].error then
self:error("(dofile): %s", values[1].error)
print("\nTRACEBACK:\n\n" .. values[1].traceback .. "\nLOCALS:\n\n" .. values[1].locals)
else
self:error("(dofile): %s", tostring(values[1]))
end
end end
return unpack(values) return unpack(values)