diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-03-22 15:07:27 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-03-22 15:07:27 +0000 |
commit | 995f757ab22f6c4bfbba4eb41d337a5314ef9086 (patch) | |
tree | af60fdd6a8f0226405ee8e0accf62925e7b889e2 /util/debug.lua | |
parent | 4689bd441e02d84d1b4d7c92c799c506ded4d400 (diff) | |
download | prosody-995f757ab22f6c4bfbba4eb41d337a5314ef9086.tar.gz prosody-995f757ab22f6c4bfbba4eb41d337a5314ef9086.zip |
util.debug: Attempt to get debug.traceback() parameter handling correct (again)
Diffstat (limited to 'util/debug.lua')
-rw-r--r-- | util/debug.lua | 6 |
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 ""; |