lua-users home
lua-l archive

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

On 13.03.2011 18:41, Matthew Wild wrote:
 Can you not throw a table, containing the message and additional
 information, then throw again just the message from your handler?

I can get the additional information at any point in the program, but
the problem is appending it to error message and still reporting all the
information about error normally being reported in the target
application. The standard error handling function can only be invoked if
I call 'error' before or after xpcall, but if traceback is formed at
that point it wouldn't contain any useful information, because
some_function and functions it calls wouldn't be there. I cannot pass
additional information to 'error' function either, because not only my
code calls it, 'error' can be called from custom persistence functions
called from my code.

However, when I think more of it, what I really want is a hook that
would only be called when lua_error is called, so I can change the
message just before lua_error does its job.

Best regards,
Sergey Rozhenko