projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2cde638
)
Optimized error handling
author
Steven Barth
<steven@midlink.org>
Fri, 5 Sep 2008 09:37:02 +0000
(09:37 +0000)
committer
Steven Barth
<steven@midlink.org>
Fri, 5 Sep 2008 09:37:02 +0000
(09:37 +0000)
libs/web/luasrc/dispatcher.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/dispatcher.lua
b/libs/web/luasrc/dispatcher.lua
index e3dc6370ebbbf12c60c2ebd400909adb5f4daab2..7692dd2262d158725fd5da263ee0b02d5c647715 100644
(file)
--- 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")
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
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")
end
luci.template.render("cbi/header")
@@
-493,18
+485,10
@@
function form(model)
require("luci.cbi")
require("luci.template")
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
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")
end
luci.template.render("header")