Make skooma loaders fail when no file is found
This commit is contained in:
parent
7a42c32f36
commit
62183de78c
2 changed files with 8 additions and 2 deletions
|
@ -17,7 +17,10 @@ end})
|
||||||
-- @function load
|
-- @function load
|
||||||
return function(name)
|
return function(name)
|
||||||
name = tostring(name)..'.html.skooma'
|
name = tostring(name)..'.html.skooma'
|
||||||
local template = loadfile(name, "t", env)
|
local template, err = loadfile(name, "t", env)
|
||||||
|
if template == nil then
|
||||||
|
return nil, err
|
||||||
|
end
|
||||||
if setfenv then
|
if setfenv then
|
||||||
setfenv(template, env)
|
setfenv(template, env)
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,10 @@ end})
|
||||||
-- @function load
|
-- @function load
|
||||||
return function(name)
|
return function(name)
|
||||||
name = tostring(name)..'.xml.skooma'
|
name = tostring(name)..'.xml.skooma'
|
||||||
local template = loadfile(name, "t", env)
|
local template, err = loadfile(name, "t", env)
|
||||||
|
if template == nil then
|
||||||
|
return nil, err
|
||||||
|
end
|
||||||
if setfenv then
|
if setfenv then
|
||||||
setfenv(template, env)
|
setfenv(template, env)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue