From c8347f16c672792eb21f6d707e7f483290bfe8ee Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Sat, 31 Oct 2026 09:10:04 +0530 Subject: Provide an index in the error message. --- mkelf.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mkelf.lua') 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() -- cgit v1.3