lua-users home
lua-l archive

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


See luaX_errorline. I modified it to return a table containing the line
number along with the error message. That does require a little more work
for processing errors on the other end though you can mitigate some of it by
including a metatable with a __tostring metamethod on the table.

Mark

P.S. Is there a fundamental reason why __tostring isn't able to be a string
rather than a function?

on 5/16/04 8:39 AM, Will Leshner at leshner@ljug.com wrote:

> Excuse me if this is very basic, but I'm wondering if there is a way to
> get line number for errors that occur when Lua compiles a chunk. I'm
> doing luaL_loadbuffer() and I do get errors, but no line numbers. I'd
> like to be able to report back to the user exactly what line the error
> occurred on.
> 
> Thanks.
>