From 9dfa0f1f15c413540e932a04e94419a8a3b37dcf Mon Sep 17 00:00:00 2001 From: faketruth Date: Mon, 30 Jan 2012 16:47:26 +0000 Subject: Added a WebAdmin interface to view users their groups, and the permissions of groups. cChunk::Tick did an assertion in cCSLock, I used a cCSUnlock to fix it, but not sure if this is correct. git-svn-id: http://mc-server.googlecode.com/svn/trunk@194 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWebPlugin_Lua.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source/cWebPlugin_Lua.cpp') diff --git a/source/cWebPlugin_Lua.cpp b/source/cWebPlugin_Lua.cpp index f92cb1690..40e8fcb76 100644 --- a/source/cWebPlugin_Lua.cpp +++ b/source/cWebPlugin_Lua.cpp @@ -84,18 +84,21 @@ std::string cWebPlugin_Lua::HandleRequest( HTTPRequest* a_Request ) tolua_pushusertype( LuaState, a_Request, "HTTPRequest" ); LOGINFO("Calling bound function! :D"); int s = lua_pcall( LuaState, 1, 1, 0); - if( report_errors( LuaState, s ) ) + + if ( s != 0 ) { + std::string err = lua_tostring(LuaState, -1); + LOGERROR("-- %s", err.c_str() ); + lua_pop(LuaState, 1); LOGINFO("error. Stack size: %i", lua_gettop(LuaState) ); - return false; + return err; // Show the error message in the web page, looks cool } - if( !lua_isstring( LuaState, -1 ) ) { LOGWARN("WARNING: WebPlugin tab '%s' did not return a string!", Tab->Title.c_str() ); lua_pop(LuaState, 1); // Pop return value - return ""; + return std::string("WARNING: WebPlugin tab '") + Tab->Title + std::string("' did not return a string!"); } RetVal += tolua_tostring(LuaState, -1, 0); -- cgit v1.2.3