lua-users home
lua-l archive

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


I tried to minimize my failing example, and the minimization caused it to start working.
So now I have a lead on where the bug is.
Thanks for your help.

Johnicholas

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br on behalf of Luiz Henrique de Figueiredo
Sent: Thu 8/28/2008 4:18 PM
To: Lua list
Subject: Re: luaL_error from a lua_sethook function?
 
> I was surprised at finding that (unless I'm mistaken) it's not possible to catch a luaL_error thrown from a lua_sethook function.

Sure is. The code below works fine. Could you please show us your code?
 
function f(x,y,z)
	print("hook",x,y,z)
	error"boom"
end

function g()
	print"0"
	debug.sethook(f,"l")
	print"1"
	print"2"
end

print("pcall",pcall(g))

<<winmail.dat>>