Skip to content

Commit

Permalink
instead.lua: require error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
hugeping committed Aug 27, 2023
1 parent 99dacf3 commit 77af47c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tiny/instead.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@ local function make_require(n, env)
local f = io.open(name, "r")
if f then
f:close()
mods[n] = make_dofile(name, env)
mods[n] = make_dofile(name, env) or true
break
end
end
if not mods[n] then
error("Can't load module: "..tostring(n), 2)
end
return mods[n]
end

Expand Down

0 comments on commit 77af47c

Please sign in to comment.