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
|
||||
return function(name)
|
||||
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
|
||||
setfenv(template, env)
|
||||
end
|
||||
|
|
|
@ -17,7 +17,10 @@ end})
|
|||
-- @function load
|
||||
return function(name)
|
||||
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
|
||||
setfenv(template, env)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue