Correct the error reporting positions.
This commit is contained in:
parent
c082ae4ddc
commit
1f79e2d345
|
@ -19,7 +19,7 @@ function _check_optional(arg, argtype)
|
||||||
if type(arg) ~= 'nil' then
|
if type(arg) ~= 'nil' then
|
||||||
if type(argtype) == 'string' then
|
if type(argtype) == 'string' then
|
||||||
if type(arg) ~= argtype then
|
if type(arg) ~= argtype then
|
||||||
error(argtype .. ' argument expected, got ' .. type(arg), 3)
|
error(argtype .. ' argument expected, got ' .. type(arg), 4)
|
||||||
end
|
end
|
||||||
elseif type(argtype) == 'table' then
|
elseif type(argtype) == 'table' then
|
||||||
local b = false
|
local b = false
|
||||||
|
@ -27,7 +27,7 @@ function _check_optional(arg, argtype)
|
||||||
if type(arg) == t then b = true end
|
if type(arg) == t then b = true end
|
||||||
end
|
end
|
||||||
if b == false then
|
if b == false then
|
||||||
error(argtype .. ' argument expected, got ' .. type(arg), 3)
|
error(argtype .. ' argument expected, got ' .. type(arg), 4)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue