feat: show the table we can't parse

This commit is contained in:
Kazhnuz 2021-08-07 12:13:30 +02:00
parent 5d157e5251
commit dac38cb49e

View file

@ -139,7 +139,10 @@ function Table.parse(table, structure, nullableNbr)
nullableNbr = nullableNbr or 0
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
for i, key in ipairs(structure) do
parsedTable[key] = table[i]