1
0

Made errors slightly more tolerant.

This commit is contained in:
Jon Michael Aanes 2019-06-10 19:41:19 +02:00
parent 60e525a367
commit 99650fb573

View File

@ -177,7 +177,8 @@ local function strings_with_highest_similarity (str, list_of_other_str)
if type(str) ~= 'string' then error(('[errors/internal]: Bad argument #1, expected string, got %s (%s)'):format(str, type(str))) end if type(str) ~= 'string' then error(('[errors/internal]: Bad argument #1, expected string, got %s (%s)'):format(str, type(str))) end
if type(list_of_other_str) ~= 'table' then error(('[errors/internal]: Bad argument #2, expected table, got %s (%s)'):format(list_of_other_str, type(list_of_other_str))) end if type(list_of_other_str) ~= 'table' then error(('[errors/internal]: Bad argument #2, expected table, got %s (%s)'):format(list_of_other_str, type(list_of_other_str))) end
for i = 1, #list_of_other_str do for i = 1, #list_of_other_str do
if type(list_of_other_str[i]) ~= 'string' then error(('[errors/internal]: Bad argument #2, expected sequence of strings, but got %s (%s) on index %i'):format(list_of_other_str[i], type(list_of_other_str[i]), i)) end list_of_other_str[i] = tostring(list_of_other_str[i])
--if type(list_of_other_str[i]) ~= 'string' then error(('[errors/internal]: Bad argument #2, expected sequence of strings, but got %s (%s) on index %i in sequence'):format(list_of_other_str[i], type(list_of_other_str[i]), i)) end
end end
-- Do work -- Do work