Discussion:
Imperfect error message from string.gsub
Dirk Laurie
2018-12-06 05:51:44 UTC
Permalink
One sonetimes gets:

bad argument #2 to 'gsub' (string/function/table expected)

By analogy with other messages, the message might have said

bad argument #2 to 'gsub' (string/function/table expected, got nil)
bad argument #2 to 'gsub' (string/function/table expected, got number)

etc. which would immediately give a lead to what the coding mistake was.
Loading...