summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/dispatcher.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-09-05 09:37:02 +0000
committerSteven Barth <steven@midlink.org>2008-09-05 09:37:02 +0000
commitcac36db0805f0238f374db15408c6820ab08eb60 (patch)
tree4769e58e782f03fee99f933c81ef33b0afb9faee /libs/web/luasrc/dispatcher.lua
parent2cde638a531eb80990fe9263041f7477cc89d2ce (diff)
Optimized error handling
Diffstat (limited to 'libs/web/luasrc/dispatcher.lua')
-rw-r--r--libs/web/luasrc/dispatcher.lua24
1 files changed, 4 insertions, 20 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index e3dc6370e..7692dd226 100644
--- a/libs/web/luasrc/dispatcher.lua
+++ b/libs/web/luasrc/dispatcher.lua
@@ -464,18 +464,10 @@ function cbi(model)
require("luci.cbi")
require("luci.template")
- local stat, maps = luci.util.copcall(luci.cbi.load, model, ...)
- if not stat then
- error500(maps)
- return true
- end
+ maps = luci.cbi.load(model, ...)
for i, res in ipairs(maps) do
- local stat, err = luci.util.copcall(res.parse, res)
- if not stat then
- error500(err)
- return true
- end
+ res:parse()
end
luci.template.render("cbi/header")
@@ -493,18 +485,10 @@ function form(model)
require("luci.cbi")
require("luci.template")
- local stat, maps = luci.util.copcall(luci.cbi.load, model, ...)
- if not stat then
- error500(maps)
- return true
- end
+ maps = luci.cbi.load(model, ...)
for i, res in ipairs(maps) do
- local stat, err = luci.util.copcall(res.parse, res)
- if not stat then
- error500(err)
- return true
- end
+ res:parse()
end
luci.template.render("header")