[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: context in error handler
- From: Gaspard Bucher <gaspard@...>
- Date: Wed, 25 Jan 2012 14:42:23 +0100
Hi List !
I am trying to prepare an error function before executing a callback from C++. The callback uses it's own lua thread with the following stack (just before the call):
<self> <err_func> <func> <self> <...>
If func(self, ...) fails, I would like to be able to find the "self" table back in the error function. Is this possible ? Do I have to create a different function for each object with an upvalue ?
-- Ideal code
function err(self, msg)
-- ...
end