lua-users home
lua-l archive

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


	Hi Ashwin

On Thu, 3 Nov 2011, Ashwin Hirschi wrote:
...
	 errorlevel.lua:20: strings only, please!
	 stack traceback:
		 [C]: in function 'error'
		 errorlevel.lua:14: in function 'down2'
		 errorlevel.lua:9: in function 'down1'
		 errorlevel.lua:4: in function 'go4it'
		 errorlevel.lua:20: in main chunk
		 [C]: in ?

The very first line correctly identifies the line (20) in the source code I'd like it to (and indicated when calling error with level 4).

However, the traceback begins with 4 "extra" lines that'll likely confuse the person who's only seeing the client code... (while also exposing internal/implementation details I'd like to hide!).

Please note that in "real life" the client code is much more complicated and often nested. So, having a traceback definitely does make sense.

I'd just like it to be a bit more to the point when I've indicated as much to the error function. Isn't that the function of error's level parameter in the first place?

What are your thoughts?
	I think the information above is quite useful, but I think your
point does make sense.	I confess I am used to read this kind of message,
but I believe it would be enough to add a signal at the proper line.
Something like that:

 	 errorlevel.lua:20: strings only, please!
	 stack traceback:
		 [C]: in function 'error'
		 errorlevel.lua:14: in function 'down2'
		 errorlevel.lua:9: in function 'down1'
		 errorlevel.lua:4: in function 'go4it'
		> errorlevel.lua:20: in main chunk <
		 [C]: in ?

	What do you think?

	Regards,
		Tomás