Name
lua_throwerror -- throw an error (V5.0)
Synopsis
void lua_throwerror(lua_State *L, int error);
Function
This is not an official Lua API but a Hollywood extension. lua_throwerror() allows you to jump directly into Hollywood's error handler, forcing it to show the message associated with the specified error code. Internally, lua_throwerror() uses longjmp() to jump directly into the error handler.

Use this function only if you have very good reason to do so. The normal way of indicating an error is to have your function return its error code back to Hollywood. If this is not possible, maybe because the error has occurred in a callback that doesn't allow you to delegate an error code to the main function in a convenient way, you may call lua_throwerror() to cause an immediate error exit. Make sure that you free any resources that your function has allocated before calling lua_throwerror(), though, since this function never returns.

Designer compatibility
Unsupported

Inputs
L
pointer to the lua_State
error
error code to throw; must not be 0

Show TOC