MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / print_output

Function print_output

ogsr_engine/Layers/xrRender/ResourceManager_Scripting.cpp:249–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249bool print_output(const char* caScriptFileName, int errorCode)
250{
251 auto Prefix = "";
252 if (errorCode)
253 {
254 switch (errorCode)
255 {
256 case LUA_ERRRUN: {
257 Prefix = "SCRIPT RUNTIME ERROR";
258 break;
259 }
260 case LUA_ERRMEM: {
261 Prefix = "SCRIPT ERROR (memory allocation)";
262 break;
263 }
264 case LUA_ERRERR: {
265 Prefix = "SCRIPT ERROR (while running the error handler function)";
266 break;
267 }
268 case LUA_ERRFILE: {
269 Prefix = "SCRIPT ERROR (while running file)";
270 break;
271 }
272 case LUA_ERRSYNTAX: {
273 Prefix = "SCRIPT SYNTAX ERROR";
274 break;
275 }
276 case LUA_YIELD: {
277 Prefix = "Thread is yielded";
278 break;
279 }
280 default: NODEFAULT;
281 }
282 }
283 auto traceback = get_lua_traceback(LSVM);
284 if (!lua_isstring(LSVM, -1)) //НЕ УДАЛЯТЬ! Иначе будут вылeты без лога!
285 {
286 Msg("*********************************************************************************");
287 Msg("[ResourceManager_Scripting.print_output(%s)] %s!\n%s", caScriptFileName, Prefix, traceback);
288 Msg("*********************************************************************************");
289 return false;
290 }
291 auto S = lua_tostring(LSVM, -1);
292 Msg("*********************************************************************************");
293 Msg("[ResourceManager_Scripting.print_output(%s)] %s:\n%s\n%s", caScriptFileName, Prefix, S, traceback);
294 Msg("*********************************************************************************");
295 return true;
296}
297
298bool load_buffer(const char* caBuffer, size_t tSize, const char* caScriptName, const char* caNameSpaceName)
299{

Callers 9

load_bufferFunction · 0.70
do_fileFunction · 0.70
LuaErrorFunction · 0.70
lua_cast_failedFunction · 0.70
lua_pcall_failedFunction · 0.70
lua_panicFunction · 0.70
lua_cast_failedFunction · 0.50
load_bufferMethod · 0.50
do_fileMethod · 0.50

Calls 3

MsgFunction · 0.85
get_lua_tracebackFunction · 0.70
lua_isstringFunction · 0.50

Tested by

no test coverage detected