Created
April 2, 2014 16:15
-
-
Save britzl/9937367 to your computer and use it in GitHub Desktop.
Example of how debug.traceback() works
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function a() | |
print(debug.traceback()) | |
end | |
local function b() | |
a() | |
end | |
local function c() | |
b() | |
end | |
c() | |
--[[ Will output: | |
stack traceback: | |
traceback.lua:2: in function 'a' | |
traceback.lua:6: in function 'b' | |
traceback.lua:10: in function 'c' | |
traceback.lua:13: in main chunk | |
[C]: ? | |
--]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment