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 | 451abcc73f8315134c31478450b53494f1bfd455 (patch) | |
tree | af60fdd6a8f0226405ee8e0accf62925e7b889e2 | |
parent | 57b4839a319c57177c831eeb1ca57eb51e1eb971 (diff) | |
download | prosody-451abcc73f8315134c31478450b53494f1bfd455.tar.gz prosody-451abcc73f8315134c31478450b53494f1bfd455.zip |
util.debug: Attempt to get debug.traceback() parameter handling correct (again)
-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 ""; |