projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove remaining references to boa and lucid
[project/luci.git]
/
libs
/
web
/
luasrc
/
template.lua
diff --git
a/libs/web/luasrc/template.lua
b/libs/web/luasrc/template.lua
index
80a3206
..
72127d1
100644
(file)
--- a/
libs/web/luasrc/template.lua
+++ b/
libs/web/luasrc/template.lua
@@
-78,7
+78,9
@@
function Template.__init__(self, name)
-- If we have no valid template throw error, otherwise cache the template
if not self.template then
-- If we have no valid template throw error, otherwise cache the template
if not self.template then
- error(err)
+ error("Failed to load template '" .. name .. "'.\n" ..
+ "Error while parsing template '" .. sourcefile .. "':\n" ..
+ (err or "Unknown syntax error"))
else
self.cache[name] = self.template
end
else
self.cache[name] = self.template
end
@@
-99,6
+101,7
@@
function Template.render(self, scope)
-- Now finally render the thing
local stat, err = util.copcall(self.template)
if not stat then
-- Now finally render the thing
local stat, err = util.copcall(self.template)
if not stat then
- error("Error in template %s: %s" % {self.name, err})
+ error("Failed to execute template '" .. self.name .. "'.\n" ..
+ "A runtime error occured: " .. tostring(err or "(nil)"))
end
end
end
end