# HG changeset patch # User Matthew Wild # Date 1553085908 0 # Node ID d812031c8716642a64aedffcea0adcb95962ed6d # Parent 99291e124449039363f25c7c5d9c3b8c8b995ffa configmanager: Pass through warnings from included files diff -r 99291e124449 -r d812031c8716 core/configmanager.lua --- a/core/configmanager.lua Wed Mar 20 12:20:51 2019 +0000 +++ b/core/configmanager.lua Wed Mar 20 12:45:08 2019 +0000 @@ -7,8 +7,8 @@ -- local _G = _G; -local setmetatable, rawget, rawset, io, os, error, dofile, type, pairs = - setmetatable, rawget, rawset, io, os, error, dofile, type, pairs; +local setmetatable, rawget, rawset, io, os, error, dofile, type, pairs, ipairs = + setmetatable, rawget, rawset, io, os, error, dofile, type, pairs, ipairs; local format, math_max, t_insert = string.format, math.max, table.insert; local envload = require"util.envload".envload; @@ -212,6 +212,11 @@ if f then local ret, err = parser.load(f:read("*a"), file, config_table); if not ret then error(err:gsub("%[string.-%]", file), 0); end + if err then + for _, warning in ipairs(err) do + t_insert(warnings, warning); + end + end end if not f then error("Error loading included "..file..": "..err, 0); end return f, err;