Skip to content

Commit 64256a0

Browse files
authored
fix: preserve original error message on missing submodule
1 parent 9fbf722 commit 64256a0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/mods/init.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ return setmetatable({ _VERSION = "mods 0.6.0" }, { -- x-release-please-version
55
local modname = "mods." .. tostring(k)
66
local ok, v = pcall(require, modname)
77
if not ok then
8-
error('unknown mods module "' .. tostring(k) .. '"', 2)
8+
error(v, 2)
99
end
10-
rawset(t, k, v)
11-
return v
10+
return rawset(t, k, v)[k]
1211
end,
1312
})

0 commit comments

Comments
 (0)