Jump to content
Posted 06 December 2009 - 10:31 PM
Posted 06 December 2009 - 10:43 PM
lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf);
Sets a new panic function and returns the old one.
If an error happens outside any protected environment, Lua calls a panic function and then calls exit(EXIT_FAILURE), thus exiting the host application. Your panic function can avoid this exit by never returning (e.g., doing a long jump).
The panic function can access the error message at the top of the stack.
Posted 06 December 2009 - 10:46 PM
Posted 06 December 2009 - 10:50 PM
Quote:If you are using lua_call and not lua_pcall or lua_cpcall then you are in unprotected mode.
How do i know if im running in protected or unprotected mode
Why is there so extreamly low on information about this?
Is there a way to hook a custom error function when a lua error occurres? For example if i want display a message box with error information in a windows application instead of stdout in a console app.
Posted 06 December 2009 - 11:33 PM
Posted 07 December 2009 - 02:05 AM