X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=libs%2Fuvl%2Fluasrc%2Fuvl%2Ferrors.lua;h=aa13317cc963c90daa2c6715bd694a74ab8ecb06;hb=119aeff2c70e9890b788a9a4e8b6300f64668280;hp=fa177fb7635f86fa4c2e9e15a21425f157c28607;hpb=f77d92b2bee1b2878b1b08b09763a9f47606503d;p=project%2Fluci.git diff --git a/libs/uvl/luasrc/uvl/errors.lua b/libs/uvl/luasrc/uvl/errors.lua index fa177fb76..aa13317cc 100644 --- a/libs/uvl/luasrc/uvl/errors.lua +++ b/libs/uvl/luasrc/uvl/errors.lua @@ -19,8 +19,8 @@ local uvl = require "luci.uvl" local util = require "luci.util" local string = require "string" -local luci, tonumber, unpack, ipairs, type = - luci, tonumber, unpack, ipairs, type +local luci, tonumber, tostring, unpack, ipairs, type = + luci, tonumber, tostring, unpack, ipairs, type module "luci.uvl.errors" @@ -128,7 +128,7 @@ function error.string(self,pad) :gsub("%%s", self.section or '(nil)') :gsub("%%S", self.stype or '(nil)') :gsub("%%o", self.option or '(nil)') - :gsub("%%v", self.value or '(nil)') + :gsub("%%v", self.value and tostring(self.value) or '(nil)') :gsub("%%t", self.object and self.object:type() or '(nil)' ) :gsub("%%T", self.object and self.object:title() or '(nil)' ) :gsub("%%([1-9])", function(n) return self.args[tonumber(n)] or '(nil)' end)