* luci/libs/uvl: fix error handling of OPT_INVVALUE too
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 3 Sep 2008 22:02:35 +0000 (22:02 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 3 Sep 2008 22:02:35 +0000 (22:02 +0000)
libs/uvl/luasrc/uvl.lua
libs/uvl/luasrc/uvl/errors.lua

index 007a37d..b1d4810 100644 (file)
@@ -321,7 +321,7 @@ function UVL._validate_option( self, option, nodeps )
                                        for i, v in ipairs(val) do
                                                if not self.datatypes[dt]( v ) then
                                                        return false, option:error(
-                                                               ERR.OPT_INVVALUE(option, dt)
+                                                               ERR.OPT_INVVALUE(option, { v, dt })
                                                        )
                                                end
                                        end
index c53a4ab..aa1d8fb 100644 (file)
@@ -54,7 +54,7 @@ ERRCODES = {
        { 'OPT_UNKNOWN',        'Option "%i" (%I) not found in scheme' },
        { 'OPT_REQUIRED',       'Required option "%i" has no value' },
        { 'OPT_BADVALUE',       'Value "%1" of option "%i" is not defined in enum %2' },
-       { 'OPT_INVVALUE',       'Value "%v" of given option "%i" does not validate as datatype "%1"' },
+       { 'OPT_INVVALUE',       'Value "%1" of given option "%i" does not validate as datatype "%2"' },
        { 'OPT_NOTLIST',        'Option "%i" is defined as list but stored as plain value' },
        { 'OPT_DATATYPE',       'Option "%i" has unknown datatype "%1"' },
        { 'OPT_NOTFOUND',       'Option "%p.%s.%o" not found in config' },