feat: Add stack trace to argument check error

Just the error message is not enough to track errors in commonly used
functions.
This commit is contained in:
Lucas Schwiderski 2023-02-27 09:45:46 +01:00
parent b6bdc3848e
commit edf5b33234
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8

View file

@ -14,8 +14,10 @@ function dmf.check_wrong_argument_type(mod, dmf_function_name, argument_name, ar
end end
end end
mod:error("(%s): argument '%s' should have the '%s' type, not '%s'", dmf_function_name, argument_name, mod:error(
table.concat(allowed_types, "/"), argument_type) "(%s): argument '%s' should have the '%s' type, not '%s'\n%s",
dmf_function_name, argument_name, table.concat(allowed_types, "/"), argument_type, Script.callstack()
)
return true return true
end end