lua-users home
lua-l archive

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


> I've followed the example in rings in my projects:
> http://www.keplerproject.org/rings/ .  They use debug.traceback, which
> gives really nice error feedback.

In my case I want less information. The default error string looks
something like

	[string "<code>"]:<line_number>: <error_message>

Since <code> in my case is a multiline string, it's not useful to show
that to the user It only ends up being the first string in the file and
not the code that actually is the problem. I'd like the error message to
be

	<line_number> : <error_message>

I've experimentally determined ( playing with xpcall ) that the argument
to the errorfunc() is <error_message>, but I'm not sure how to pull the
line number out. I looked at the source for debug.traceback but it's
pretty far over my comprehension of lua.