diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-08-27 18:55:42 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-08-27 18:55:42 +0000 |
commit | 8be65461bcc64250f4ee1df3eef8de22f2c3f87f (patch) | |
tree | 3e8ecdfff106aa136b9bdee0ccac0c5d612fff9c /libs/uvl | |
parent | 339042c46a187567de3e19b6f383ed72ed007f7d (diff) |
* luci/libs: uvl: fix crash when trying to validate malformed or not-existing configuration, more verbose error message for uci load failure
Diffstat (limited to 'libs/uvl')
-rw-r--r-- | libs/uvl/luasrc/uvl.lua | 6 | ||||
-rw-r--r-- | libs/uvl/luasrc/uvl/errors.lua | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua index 5cad3d20e..24dc3a25d 100644 --- a/libs/uvl/luasrc/uvl.lua +++ b/libs/uvl/luasrc/uvl.lua @@ -971,7 +971,7 @@ section = luci.util.class(uvlitem) function section.__init__(self, scheme, co, c, s) self.cref = { c, s } - self.sref = { c, co[s] and co[s]['.type'] or s } + self.sref = { c, co and co[s] and co[s]['.type'] or s } self.c = co self.s = scheme self.t = luci.uvl.TYPE_SECTION @@ -1022,7 +1022,7 @@ option = luci.util.class(uvlitem) function option.__init__(self, scheme, co, c, s, o) self.cref = { c, s, o } - self.sref = { c, co[s] and co[s]['.type'] or s, o } + self.sref = { c, co and co[s] and co[s]['.type'] or s, o } self.c = co self.s = scheme self.t = luci.uvl.TYPE_OPTION @@ -1071,7 +1071,7 @@ enum = luci.util.class(option) function enum.__init__(self, scheme, co, c, s, o, v) self.cref = { c, s, o, v } - self.sref = { c, co[s] and co[s]['.type'] or s, o, v } + self.sref = { c, co and co[s] and co[s]['.type'] or s, o, v } self.c = co self.s = scheme self.t = luci.uvl.TYPE_ENUM diff --git a/libs/uvl/luasrc/uvl/errors.lua b/libs/uvl/luasrc/uvl/errors.lua index cf7d287db..f3ae4b914 100644 --- a/libs/uvl/luasrc/uvl/errors.lua +++ b/libs/uvl/luasrc/uvl/errors.lua @@ -18,7 +18,7 @@ module( "luci.uvl.errors", package.seeall ) require("luci.util") ERRCODES = { - { 'UCILOAD', 'Unable to load config "%p"' }, + { 'UCILOAD', 'Unable to load config "%p" (syntax error or file not found)' }, { 'SCHEME', 'Error in scheme "%p":\n%c' }, { 'CONFIG', 'Error in config "%p":\n%c' }, |