aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2026-10-31 09:10:04 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2026-10-31 09:17:05 +0530
commitc8347f16c672792eb21f6d707e7f483290bfe8ee (patch)
tree3572130c65a1f9e482a9080e4ea8db157ca82ec7
parenta4c87e8e0c68bc2c68bcca14e5c007c6f07bab53 (diff)
Provide an index in the error message.
-rw-r--r--mkelf.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/mkelf.lua b/mkelf.lua
index eb4c67b..a70317f 100644
--- a/mkelf.lua
+++ b/mkelf.lua
@@ -42,9 +42,9 @@ local function loadconfig(fn)
if type(t) ~= "table" then
error("segments must be a table", 2)
end
- for _, segment in ipairs(t) do
+ for i, segment in ipairs(t) do
if type(segment) ~= "table" then
- error("segment must be a table", 2)
+ error(("segment #%d must be a table"):format(i), 2)
end
segment = setmetatable(segment, segment_mt)
segment:normalize()
@@ -56,9 +56,9 @@ local function loadconfig(fn)
if type(t) ~= "table" then
error("sections must be a table", 2)
end
- for _, section in ipairs(t) do
+ for i, section in ipairs(t) do
if type(section) ~= "table" then
- error("section must be a table", 2)
+ error(("section #%d must be a table"):format(i), 2)
end
section = setmetatable(section, section_mt)
section:normalize()