summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/dispatcher.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-03-22 21:26:44 +0000
committerSteven Barth <steven@midlink.org>2008-03-22 21:26:44 +0000
commitef01ff75db17f23a90757cf473778cfefe1ad120 (patch)
tree954eaecffa563e1d97da7ed4288e65254ee46041 /src/ffluci/dispatcher.lua
parent93c55f3c5d7d253423c9d5695b8d71388bd21988 (diff)
* CBI updates
Diffstat (limited to 'src/ffluci/dispatcher.lua')
-rw-r--r--src/ffluci/dispatcher.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ffluci/dispatcher.lua b/src/ffluci/dispatcher.lua
index f3a62bb193..ee836043d2 100644
--- a/src/ffluci/dispatcher.lua
+++ b/src/ffluci/dispatcher.lua
@@ -116,7 +116,7 @@ end
function error500(message)
ffluci.http.status(500, "Internal Server Error")
- if not pcall(ffluci.template.render, "error500") then
+ if not pcall(ffluci.template.render, "error500", {message=message}) then
ffluci.http.textheader()
print(message)
end
@@ -171,8 +171,13 @@ function cbi(request)
i18n.loadc(request.module)
- stat, map = pcall(cbi.load, path)
+ local stat, map = pcall(cbi.load, path)
if stat then
+ local stat, err = pcall(map.parse, map)
+ if not stat then
+ disp.error500(err)
+ return
+ end
tmpl.render("cbi/header")
map:render()
tmpl.render("cbi/footer")
@@ -202,8 +207,13 @@ function dynamic(request)
return
end
- stat, map = pcall(cbi.load, path)
+ local stat, map = pcall(cbi.load, path)
if stat then
+ local stat, err = pcall(map.parse, map)
+ if not stat then
+ disp.error500(err)
+ return
+ end
tmpl.render("cbi/header")
map:render()
tmpl.render("cbi/footer")