aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2019-03-20 12:19:43 +0000
committerMatthew Wild <mwild1@gmail.com>2019-03-20 12:19:43 +0000
commitd4db66791dd4136374610889c68789ec3b7a186c (patch)
tree6e5ef589b27151d5f5feec57a285ebc8906cf388 /core
parent67b08fccf7d370c1df426890057d2775edd49797 (diff)
downloadprosody-d4db66791dd4136374610889c68789ec3b7a186c.tar.gz
prosody-d4db66791dd4136374610889c68789ec3b7a186c.zip
configmanager: Add support for returning warnings
Diffstat (limited to 'core')
-rw-r--r--core/configmanager.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/configmanager.lua b/core/configmanager.lua
index 1e67da9b..579db3b0 100644
--- a/core/configmanager.lua
+++ b/core/configmanager.lua
@@ -9,7 +9,7 @@
local _G = _G;
local setmetatable, rawget, rawset, io, os, error, dofile, type, pairs =
setmetatable, rawget, rawset, io, os, error, dofile, type, pairs;
-local format, math_max = string.format, math.max;
+local format, math_max, t_insert = string.format, math.max, table.insert;
local envload = require"util.envload".envload;
local deps = require"util.dependencies";
@@ -102,6 +102,7 @@ do
local pcall = _G.pcall;
parser = {};
function parser.load(data, config_file, config_table)
+ local warnings = {};
local env;
-- The ' = true' are needed so as not to set off __newindex when we assign the functions below
env = setmetatable({
@@ -217,7 +218,7 @@ do
return nil, err;
end
- return true;
+ return true, warnings;
end
end