aboutsummaryrefslogtreecommitdiffstats
path: root/util
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
commit451abcc73f8315134c31478450b53494f1bfd455 (patch)
treeaf60fdd6a8f0226405ee8e0accf62925e7b889e2 /util
parent57b4839a319c57177c831eeb1ca57eb51e1eb971 (diff)
downloadprosody-451abcc73f8315134c31478450b53494f1bfd455.tar.gz
prosody-451abcc73f8315134c31478450b53494f1bfd455.zip
util.debug: Attempt to get debug.traceback() parameter handling correct (again)
Diffstat (limited to 'util')
-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 "";