lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Oct 20, 2014 at 6:46 AM, Andrew Starks <andrew.starks@trms.com> wrote:
> I don't know if this has broad potential for others, or not, but an error
> would be welcomed here, as well. This time for having any value that is not
> a string or `nil` in assert's second argument would have saved me hours of
> head scratching. Not having a line number/file name was very...difficult.

Well, one option is: if the error is not a string, then try to call
tostring() on it. Then we can have error objects with __tostring
defined appropriately.

'nil' can either be a special case or simply an error, as Roberto suggests.

steve d.