1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 09:59:29 +00:00

Fix string.format errors on Lua 5.1 when using booleans or nil

This commit is contained in:
Étienne Fildadut 2021-06-09 13:43:52 +02:00
parent 66f1a5a3c2
commit 3c84d1fbdd
4 changed files with 6 additions and 6 deletions

View file

@ -203,7 +203,7 @@ local codeCache = {}
function candran.loadfile(filepath, env, options)
local f, err = io.open(filepath)
if not f then
return nil, "cannot open %s":format(err)
return nil, "cannot open %s":format(tostring(err))
end
local content = f:read("*a")
f:close()
@ -321,7 +321,7 @@ function candran.searcher(modpath)
if r then
return r(modpath, filepath)
else
error("error loading candran module '%s' from file '%s':\n\t%s":format(modpath, filepath, s), 0)
error("error loading candran module '%s' from file '%s':\n\t%s":format(modpath, filepath, tostring(s)), 0)
end
end, filepath
end