lua-users home
lua-l archive

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


I read the text at and I
found it very useful ...

The main problem from my point of view is that when you transform
errors into messages (strings) and back into exceptions, you
lose the stack traceback.
So I created a module that instead of transforming transforming
errors into strings, they are transformed into exceptions objects, that
contains the stack traceback. (it uses xpcall)

But, if the exception is not catched, the lua interpreter is not able
to transform the table to a string (the metamethod __tostring is
defined) so the traceback is not displayed. So I replaced the function
debug.traceback by a function that do exactly the same but transform
the error object to a string if it is not.

I would suggest that in future lua releases, the debug.traceback
function should be able to transform any object to a string to display

Here is my module :


Mildred       <> <>
Clef GPG :    <hkp://> ou <>
Fingerprint : 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]