luaa: emit signal on runtime error

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-27 17:55:47 +02:00
parent 3739aabda1
commit b83766b4c9
1 changed files with 5 additions and 0 deletions

5
luaa.c
View File

@ -683,6 +683,11 @@ luaA_panic(lua_State *L)
static int
luaA_dofunction_on_error(lua_State *L)
{
/* duplicate string error */
lua_pushvalue(L, -1);
/* emit error signal */
signal_object_emit(L, &global_signals, "debug::error", 1);
if(!luaL_dostring(L, "return debug.traceback(\"error while running function\", 3)"))
{
/* Move traceback before error */