* luci/libs: uvl: actually create error constants in luci.uvl.error
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 27 Aug 2008 16:56:38 +0000 (16:56 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 27 Aug 2008 16:56:38 +0000 (16:56 +0000)
libs/uvl/luasrc/uvl/errors.lua

index e29de40..cf7d287 100644 (file)
@@ -64,11 +64,13 @@ ERRCODES = {
        { 'DEP_BADENUM',        'In dependency check for enum value "%i":\n%c' }
 }
 
--- build error constants
+-- build error constants and instance constructors
 for i, v in ipairs(ERRCODES) do
        luci.uvl.errors[v[1]] = function(...)
                return error(i, ...)
        end
+
+       luci.uvl.errors['ERR_'..v[1]] = i
 end