diff --git a/errors.lua b/errors.lua index 84a9798..57e0702 100644 --- a/errors.lua +++ b/errors.lua @@ -146,7 +146,7 @@ return function (module_name) __index = function (t, k) local keys = {} for k in pairs(t) do keys[#keys+1] = k end - if #keys then external_error(err_hdl, '', 'Attempting to index unknown key %s in an empty table.', k) end + if #keys == 0 then external_error(err_hdl, '', 'Attempting to index unknown key %s in an empty table.', k) end correct_error(err_hdl, '', 'Attempting to index unknown key %s, maybe you meant %s?', k, keys) end })