From 62bb487400a3c24e98112baca9ca6a06855b95ef Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 1 Jun 2010 18:51:03 +0000 Subject: additional error output at debug shell --- src/debug_shell.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debug_shell.lua b/src/debug_shell.lua index 005fb9f..a9a9340 100644 --- a/src/debug_shell.lua +++ b/src/debug_shell.lua @@ -134,12 +134,12 @@ debug_shell.exec_cmd = function() local results = { pcall(chunk) } if(results[1]) then for i,result in ipairs(results) do - if(i ~= 1) then - debug_shell.socks[2]:send(string.format("#%d: %s\n", i, tostring(result))) + if(i > 1) then + debug_shell.socks[2]:send(string.format("#%d: %s\n", i-1, tostring(result))) end end else - debug_shell.socks[2]:send("lua call failed\n") + debug_shell.socks[2]:send(string.format("lua call failed: %s\n", tostring(results[2]))) end else debug_shell.socks[2]:send("syntax error\n") -- cgit v1.2.3