Imperfect error message from string.gsub

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Imperfect error message from string.gsub

Dirk Laurie-2
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.