From e05ca494593d780c0ecf358bf66a94b224b35b5b Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 26 Jun 2017 08:56:55 +0200 Subject: Moved ApiParamError into cLuaState. --- src/Bindings/ManualBindings.cpp | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'src/Bindings/ManualBindings.cpp') diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 2c2de6296..565c636e3 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -132,46 +132,6 @@ int cManualBindings::lua_do_error(lua_State * L, const char * a_pFormat, ...) -int cManualBindings::ApiParamError(lua_State * a_LuaState, const char * a_MsgFormat, ...) -{ - // Retrieve current function name - lua_Debug entry; - VERIFY(lua_getstack(a_LuaState, 0, &entry)); - VERIFY(lua_getinfo(a_LuaState, "n", &entry)); - - // Compose the error message: - va_list argp; - va_start(argp, a_MsgFormat); - AString msg; - - #ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wformat-nonliteral" - #endif - - AppendVPrintf(msg, a_MsgFormat, argp); - - #ifdef __clang__ - #pragma clang diagnostic pop - #endif - - va_end(argp); - AString errorMsg = Printf("%s: %s", (entry.name != nullptr) ? entry.name : "", msg.c_str()); - - // Log everything into the console: - LOGWARNING("%s", errorMsg.c_str()); - // cLuaState::LogStackTrace(a_LuaState); // Do NOT log stack trace, it is already output as part of the Lua error handling - cLuaState::LogStackValues(a_LuaState, "Parameters on the stack"); - - // Raise Lua error: - lua_pushstring(a_LuaState, errorMsg.c_str()); - return lua_error(a_LuaState); -} - - - - - // Lua bound functions with special return types static int tolua_Clamp(lua_State * tolua_S) { -- cgit v1.2.3