diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/BLua.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/BLua.cc b/lib/BLua.cc index 3f7df94..799d54e 100644 --- a/lib/BLua.cc +++ b/lib/BLua.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: BLua.cc,v 1.40 2007-04-11 00:16:30 pixel Exp $ */ +/* $Id: BLua.cc,v 1.41 2007-05-22 08:46:59 pixel Exp $ */ #include <stdlib.h> #include "BLua.h" @@ -1035,15 +1035,13 @@ Lua * Lua::find(lua_State * __L) throw (GeneralException) { return i->second; } -void Lua::showerror() { +void Lua::showstack(int level) { int n = lua_gettop(L); int i; String t; - printm(M_ERROR, "Lua object: Got an LUA error, inspecting stack.\n"); - if (n == 0) { - printm(M_ERROR, "Stack empty\n"); + printm(level, "Stack empty\n"); return; } @@ -1074,10 +1072,16 @@ void Lua::showerror() { t = "Unknown"; } - printm(M_ERROR, String(i) + ": " + t + "\n"); + printm(level, String(i) + ": " + t + "\n"); } } +void Lua::showerror() { + printm(M_ERROR, "Lua object: Got an LUA error, inspecting stack.\n"); + + showstack(M_ERROR); +} + int Lua::getmetatable(int i) { return lua_getmetatable(L, i); } |