Re: Trigger panic for testing custom error handler
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Trigger panic for testing custom error handler
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2013年1月22日 14:51:53 -0200
> I have a custom error handler installed using lua_atpanic. Is there a convenient way to trigger a panic in order to test/debug the handler?
Try
lua_pushnil(L);
lua_call(L,0,0);
But note that panic functions are not meant to be generic error handlers
for Lua, just a last-resort safety net for the app. In particular, the
Lua state in a panic function is not usable.