summaryrefslogtreecommitdiffstats
path: root/aconf/error.lua
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-04-15 22:59:21 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-04-15 22:59:21 +0300
commitd9decd5a0dd0abbe7842da4400e665d96d6b8f9b (patch)
tree27a1807e9f8d1fa69b4ba0f0a2f2b5080906a825 /aconf/error.lua
parent909197f81d7cc47f6bfbaed39727c59245584bbb (diff)
downloadaconf-d9decd5a0dd0abbe7842da4400e665d96d6b8f9b.tar.bz2
aconf-d9decd5a0dd0abbe7842da4400e665d96d6b8f9b.tar.xz
use 'unpack' function from 'table' module
Diffstat (limited to 'aconf/error.lua')
-rw-r--r--aconf/error.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/aconf/error.lua b/aconf/error.lua
index 165bb46..9a288c7 100644
--- a/aconf/error.lua
+++ b/aconf/error.lua
@@ -47,7 +47,7 @@ function M.ErrorDict:collect(func, ...)
local arg = {...}
local success, res = pack(
xpcall(
- function() return func(unpack(arg)) end,
+ function() return func(table.unpack(arg)) end,
function(err)
local _, _, data = err:find('.-: (.+)')
local success, res = pcall(json.decode, data)
@@ -57,7 +57,7 @@ function M.ErrorDict:collect(func, ...)
)
)
- if success then return unpack(res) end
+ if success then return table.unpack(res) end
if type(res) == 'table' then
for label, errors in pairs(res) do
@@ -78,7 +78,7 @@ end
function M.relabel(label, ...)
local err = M.ErrorDict()
local res = {err:collect(...)}
- if err:success() then return unpack(res) end
+ if err:success() then return table.unpack(res) end
elist = ErrorList(label)
for lbl, el in pairs(err.errors) do
@@ -90,7 +90,7 @@ end
function M.call(...)
local err = M.ErrorDict()
local res = {err:collect(...)}
- if err:success() then return true, unpack(res) end
+ if err:success() then return true, table.unpack(res) end
if err.errors.system then error(err.errors.system[1]) end
return false, err.errors
end