MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / msghandler

Function msghandler

src/Chain/libraries/glua/single_glua_src/main.cpp:123–135  ·  view source on GitHub ↗

** Message handler used to run all chunks */

Source from the content-addressed store, hash-verified

121** Message handler used to run all chunks
122*/
123static int msghandler(lua_State *L) {
124 const char *msg = lua_tostring(L, 1);
125 if (msg == NULL) { /* is error object not a string? */
126 if (luaL_callmeta(L, 1, "__tostring") && /* does it have a metamethod */
127 lua_type(L, -1) == LUA_TSTRING) /* that produces a string? */
128 return 1; /* that is the message */
129 else
130 msg = lua_pushfstring(L, "(error object is a %s value)",
131 luaL_typename(L, 1));
132 }
133 luaL_traceback(L, L, msg, 1); /* append a standard traceback */
134 return 1; /* return the traceback */
135}
136
137
138/*

Callers

nothing calls this directly

Calls 4

luaL_callmetaFunction · 0.85
lua_typeFunction · 0.85
lua_pushfstringFunction · 0.85
luaL_tracebackFunction · 0.85

Tested by

no test coverage detected