| 84 | } |
| 85 | |
| 86 | LUA_API void lua_set_run_error(lua_State *L, const char *msg) |
| 87 | { |
| 88 | if (nullptr != msg && strlen(msg) > 0) |
| 89 | { |
| 90 | auto size = strlen(msg); |
| 91 | if (size >= LUA_VM_EXCEPTION_STRNG_MAX_LENGTH) |
| 92 | size = LUA_VM_EXCEPTION_STRNG_MAX_LENGTH - 1; |
| 93 | strncpy(L->runerror, msg, LUA_VM_EXCEPTION_STRNG_MAX_LENGTH); |
| 94 | L->runerror[size] = '\0'; |
| 95 | global_glua_chain_api->throw_exception(L, THINKYOUNG_API_SIMPLE_ERROR, msg); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | |
| 100 |
no test coverage detected