aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-25 23:16:37 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-25 23:16:37 +0100
commit169deb9ca6cd622b09f2b186cc605be034a8a44a (patch)
tree17034800e531b751dbadf8fe8dd2315308c5f5f7
parent1ca477397d55ede0dc9ab8759f8d56cfb44ea056 (diff)
downloadprosody-169deb9ca6cd622b09f2b186cc605be034a8a44a.tar.gz
prosody-169deb9ca6cd622b09f2b186cc605be034a8a44a.zip
util.debug: Some more magic constant fiddling. Don't ask me.
-rw-r--r--util/debug.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/debug.lua b/util/debug.lua
index 7caf21ce..16773cd1 100644
--- a/util/debug.lua
+++ b/util/debug.lua
@@ -88,9 +88,9 @@ function get_traceback_table(thread, start_level)
for level = start_level, math.huge do
local info;
if thread then
- info = debug.getinfo(thread, level);
+ info = debug.getinfo(thread, level+1);
else
- info = debug.getinfo(level);
+ info = debug.getinfo(level+1);
end
if not info then break; end
@@ -128,13 +128,13 @@ function _traceback(thread, message, level)
if type(message) == "number" then
level, message = message, nil;
else
- level = 2;
+ level = 1;
end
end
message = message and (message.."\n") or "";
- local levels = get_traceback_table(thread, level+2);
+ local levels = get_traceback_table(thread, level+3);
local last_source_desc;