feat: show the table we can't parse
This commit is contained in:
parent
5d157e5251
commit
dac38cb49e
1 changed files with 4 additions and 1 deletions
|
@ -139,7 +139,10 @@ function Table.parse(table, structure, nullableNbr)
|
||||||
nullableNbr = nullableNbr or 0
|
nullableNbr = nullableNbr or 0
|
||||||
|
|
||||||
if ((#table) > (#structure)) or ((#table) < (#structure - nullableNbr)) then
|
if ((#table) > (#structure)) or ((#table) < (#structure - nullableNbr)) then
|
||||||
error("The table to parse doesn't have the right number of arguments: " .. #table .. " instead of " .. #structure .. " and " .. nullableNbr .. " nullables")
|
error("The table to parse " .. Table.toString(table) ..
|
||||||
|
" doesn't have the right number of arguments: " .. #table ..
|
||||||
|
" instead of " .. #structure ..
|
||||||
|
" and " .. nullableNbr .. " nullables")
|
||||||
else
|
else
|
||||||
for i, key in ipairs(structure) do
|
for i, key in ipairs(structure) do
|
||||||
parsedTable[key] = table[i]
|
parsedTable[key] = table[i]
|
||||||
|
|
Loading…
Reference in a new issue