aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-03-22 15:07:27 +0000
committerMatthew Wild <mwild1@gmail.com>2012-03-22 15:07:27 +0000
commit995f757ab22f6c4bfbba4eb41d337a5314ef9086 (patch)
treeaf60fdd6a8f0226405ee8e0accf62925e7b889e2
parent4689bd441e02d84d1b4d7c92c799c506ded4d400 (diff)
downloadprosody-995f757ab22f6c4bfbba4eb41d337a5314ef9086.tar.gz
prosody-995f757ab22f6c4bfbba4eb41d337a5314ef9086.zip
util.debug: Attempt to get debug.traceback() parameter handling correct (again)
-rw-r--r--util/debug.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/debug.lua b/util/debug.lua
index 2170a6d1..f70e20dd 100644
--- a/util/debug.lua
+++ b/util/debug.lua
@@ -95,7 +95,11 @@ function debug.traceback(thread, message, level)
if level and type(message) ~= "string" then
return nil, "invalid message";
elseif not level then
- level = message or 2;
+ if type(message) == "number" then
+ level, message = message, nil;
+ else
+ level = 2;
+ end
end
message = message and (message.."\n") or "";