Can I use C++ exceptions?

Lua's basic error mechanism uses setjmp, but it is possible to compile Lua so that C++ exceptions can be used.

It is important not to let exceptions propagate across the boundary into Lua, that is, use try..catch with your code, and if an error is caught, then use lua_error to notify Lua itself.



Back